Well, if you only have one string value and a lot of integers, then you should obviously convert the string to an integer. Look at the number of string operations that you have to do to using different methods. Integer comparisons are so cheap in comparison that they can be ignored. If you convert the string to an integer, you have a single string operation. If you convert the integers to strings, you will have one string operation per value. If you on the other hand had a single integer value to compare to a lot of strings: If you convert each string to an integer and the compare the integers, you have one string operation per value. If you convert the integer value to a string and then compare that to each string, you have one string operation per value plus an additional string operation. In this case the methods will cost about the same.
--- Year happy = new Year(2007);