This week's book giveaway is in the Mac OS forum. We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line! See this thread for details.
I thought this would be a compile error, 'coz method(null) would be ambiguous (it wouldn't know which method() will be invoked.) But it compiles and prints out "Integer Version" when run! Also, when method(String) is uncommented out, then the compiler complains about ambiguous methods.
Note the inheritance tree: Object | +-Number ++| +++-Integer Since null is compatible to any object, the one furthest down the compatible path will be chosen, in this case, Integer. If you also have the overloaded method with the String parameter, then that will create two compatible paths for null, which causes the ambiguous methods error. [ June 19, 2002: Message edited by: Tybon Wu ]