This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
For the second question.. I think that inner class can extends any class other than final classes and can implement any interface.
Joined: Sep 09, 2004
Thank you for your reply Jay / Murladhar, Agree, Jay, public void add (int a, String s) is not overriding, but public void add(int a) is.. So, it is true or false based on parameters ! And, in the example given, parameters are not considered, so i don't think we should consider parameters if it is not given in question at all!
If they want to consider parameters, then they might ask full sentence, instead of single world like - void, int etc..
Joined: Aug 27, 2004
Nitin, Basic rule for overloading is that method name should remain same and parameter list should be different , there is no restriction on the return type of the overloaded method. Here is extract from K&B book which tells the rules for overloaded methods
Overloaded methods must change the argument list. Overloaded methods can change the return type. Overloaded methods can change the access modifier. Overloaded methods can declare new or broader checked exceptions. A method can be overloaded in the same class or in a subclass.
Hope that helps ya [ November 26, 2004: Message edited by: Jay Pawar ]