Given the following class definition,which of the following method definitions could be added after line 3
1. public class Tower {
2. public void foo( double s,
String str){};
3. // Insert method here
4. }
public int foo ( double s, String str){}; //1
public void Foo( double s, String str){}; //2
public void foo ( double S, String Str){}; //3
public void foo ( String str, double d){}; //4
public void foo( double[] d, String str){}; //5
the given correct answers are 2,4,5.
My analysis.
Exactly. 2 is correct because Foo is completely different method to insert
4 is correct because (double d) diffent signature is present
5 is correct because (double[] d) different signature is present
But I think 3 is also correct like (double S) is different signature.Please clarify my doubt.