Citation :
Incorrect, you chose answers 4, 5. The correct answers are 2, 4, 5.
1. public class Tower {
2. public void foo( double s, String str){};
3. // Insert method here
4. }
1. public int foo ( double s, String str){};
2. public void Foo( double s, String str){};
3. public void foo ( double S, String Str){};
4. public void foo ( String str, double d){};
5. public void foo( double[] d, String str){};
Answer 2 is correct, the uppercase method Foo is different then the lowercase foo method. Methods are different if the types of the parameters are different. The return type is not taken into consideration by the compiler to distinguish between methods at compile time and at runtime.
Answer 4 and answer 5 are correct, a different signature is defined.
|