Which of the following are true?

A) The Void class extends the Class class.
B) The Float class extends the Double class.
C) The System class extends the Runtime class.
D) The Integer class extends the Number class.

Showing Answers 1 - 2 of 2 Answers

YEDANAPARTHI SYAM MOHAN

  • Apr 4th, 2006
 

Void class (no constructor for this class) does not extend any class including Object.

 

Integer,  Float and Double Classes (all primitive data type extensions) extend Number Class, which inturn extend default Object Class

 

System class extends the default Object Class

 

Hence the answers for this question is D. Refer to the Java Docs attached below.

java.lang
Class Float

java.lang.Object

  java.lang.Number

      java.lang.Float

All Implemented Interfaces:

Comparable, Serializable

 

java.lang
Class Integer

java.lang.Object

  java.lang.Number

      java.lang.Integer

All Implemented Interfaces:

Comparable, Serializable

 

Thanks,

Y. Syam Mohan PMP

Senior Project Manager

Infosys Technologies Limited

MCity, Chennai - India.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions