Home Tutorial Java Scjp Part4 SCJP Module-4 Question-18

 
 

SCJP Module-4 Question-18
Posted on: July 10, 2010 at 12:00 AM
The program given below tests your knowledge of Inheritance and method overloading in core Java.

Given the following sample code:

public class Example5{
public float Twin(float a, float b) {...
}
public float Twin(float a1, float b1) { ...}

}

How can we correct the above code ?

1. By placing overriding method into subclass.

2. By changing the type of the arguments of overriding method.

3. By replacing overloading from overriding.    

4. By changing the name of the function.

Answer :

All of the above : (1),(2),(3) & (4)

Related Tags for SCJP Module-4 Question-18:


Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.