I have a small doubt here about the question in Marcus:
Given the following class definition, which of the following methods could be legally placed after the comment
public class Rid{
public void amethod(int i,
String s){}
//Here
}
1)public void amethod(String s, int i){}
2)public int amethod(int i, String s){}
3)public void amethod(int i, String mystring){}
4) public void Amethod(int i, String s) {}
The correct answer is 1&4.But since the overloaded can also accept different return type,i suggest that the correct answer is
1&2.Also,overloaded methods have the same name as that of overloading method.Hows the answer 4 correct?Can anyone help me?
Thanks
rubna