you guys are right. but my first instinct was to choose the method(Object o).
why, because the calling method parameter was null and null is used for objects so instinctly jumped to the method(Obejct o)
means in the exam i would have got this question as wrong !!
Originally posted by Samith Nambiar:
In such a situation the most specific parameter is chosen. Considering the hierarchy of the classes the java.io.FileNotFoundException is the most specific one and this is chosen.
Try replacing java.io.FileNotFoundException and u get a compiler error stating that the two methods
method(String s) and method(java.io.IOException s) match. This is because the compiler cannot identify the most specific one
/SAmith