Question: What restrictions are placed on method,
February 13, 2007 at 2:19 PM
Question: What restrictions are placed on method overloading? Answer: Two methods may not have the same name and argument list but different return types.
I think the answer is not correct. The answer should be "Just by changing the return type alone a method cannot be overloaded. The number and type of argguments should also differ. For example, public int add(int a, int b){ } public void add(int a,int b){ } is not overloading. The system will show error. where as, public int add(int a, int b){ } public double add(double a,double b){ } is overloading.