Sail E0 Webinar

MCQs

Total Questions : 50 | Page 5 of 5 pages
Question 41.

Which of the following methods is a method of wrapper Integer for obtaining hash 

code for the invoking object?


  1.    int hash()
  2.    int hashcode()
  3.    int hashCode()
  4.    Integer hashcode()
 Discuss Question
Answer: Option C. -> int hashCode()

None.


Question 42.

Which of the following constant are defined in Character wrapper?


  1.    MAX_RADIX
  2.    MAX_VALUE
  3.    TYPE
  4.    All of the mentioned
 Discuss Question
Answer: Option D. -> All of the mentioned

Character wrapper defines 5 constants - MAX_RADIX, MIN_RADIX, MAX_VALUE, 

MIN_VALUE & TYPE.



Question 43.

Which of the following constant are defined in Boolean wrapper?


  1.    TRUE
  2.    FLASE
  3.    TYPE
  4.    All of the mentioned
 Discuss Question
Answer: Option D. -> All of the mentioned

Boolean wrapper defines 3 constants - TRUE, FLASE & TYPE.



Question 44.

Which of the following methods Byte wrapper return the value as a double?


  1.    doubleValue()
  2.    converDouble()
  3.    getDouble()
  4.    getDoubleValue()
 Discuss Question
Answer: Option A. -> doubleValue()

doubleValue() returns the value of invoking object as double.


Question 45.

Which of the following methods return the value as a double?


  1.    doubleValue()
  2.    converDouble()
  3.    getDouble()
  4.    getDoubleValue()
 Discuss Question
Answer: Option A. -> doubleValue()

None.


Question 46.

Which of these is a wrapper for data type int?


  1.    Integer
  2.    Long
  3.    Byte
  4.    Double
 Discuss Question
Answer: Option A. -> Integer

None.


Question 47.

Which of these methods of Boolean wrapper returns boolean equivalent of an object.


  1.    getBool()
  2.    booleanValue()
  3.    getbooleanValue()
  4.    getboolValue()
 Discuss Question
Answer: Option B. -> booleanValue()

None.

Question 48.

Which of these methods of Byte wrapper can be used to obtain Byte object 

from a string?


  1.    toString()
  2.    getString()
  3.    decode()
  4.    encode()
 Discuss Question
Answer: Option C. -> decode()

decode() methods returns a Byte object that contains the value specified by string.

Question 49.

Which of these is a super class of wrappers Double and Float?


  1.    Long
  2.    Digits
  3.    Float
  4.    Number
 Discuss Question
Answer: Option D. -> Number

Number is an abstract class containing subclasses Double, Float, Byte, Short, Integer 

and Long.


Question 50.

Which of these methods of Character wrapper can be used to obtain the char value 

contained in Character object.


  1.    get()
  2.    getVhar()
  3.    getValue()
  4.    getCharacter()
 Discuss Question
Answer: Option C. -> getValue()

To obtain the char value contained in a Character object, we use charValue() method.


Latest Videos

Latest Test Papers