KnowledgeBoat Logo
|

Computer Applications

Which of the following statements are true ?

  1. The Integer class has a String- and an int-constructor.
  2. The Integer has a floatValue( ) method.
  3. The wrapper classes are contained in the java.lang.Math package.
  4. The Double class has constructors for type double and float.

Java Library Classes

14 Likes

Answer

The Integer class has a String- and an int-constructor.
The Integer has a floatValue( ) method.
The Double class has constructors for type double and float.

Reason — The Integer class has a String- and an int-constructor as we can create Integer objects by passing String and int type values at the time of object creation.

The Integer has a floatValue( ) method. The method float floatValue( ) returns the value of the invoking object as a float primitive type.

The Double class has constructors for type double and float as we can create Double objects by passing double and float type values at the time of object creation.

Answered By

7 Likes


Related Questions