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

 
 

Share on Google+Share on Google+
SCJP Module-4 Question-18
Posted on: July 10, 2010 at 12:00 AM
Advertisement
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)

Advertisement

Related Tags for SCJP Module-4 Question-18:


Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Posted on: July 10, 2010

Recommend the tutorial

Advertisements Advertisements
 

 

 

DMCA.com