Log In Register

Units


Byte And Short Wrappers - Questions and Answers

 

Practice these Byte And Short Wrappers under Java Programming walk-in interview Questions/ examination questions with best tricks and short cuts with solution. Student (candidate) who want to crack the walk in interview, competitive exams and want to find short cuts and tricks to solve questions on Byte And Short Wrappers for following purpose.


– Anyone who is wishing to increase their perfect knowledge of Byte And Short Wrappers of Java Programming.
– Anyone who is preparing for aptitude test and increase his in depth aptitude knowledge Java Programming specifically Byte And Short Wrappers.
– Anyone who is preparing for interviews (competitive examinations, govt examinations and bank examinations, off-campus or on campus interviews, walk-in interview and company interviews) having questions on Byte And Short Wrappers under Java Programming.

– Anyone who is preparing for aptitude test or competitive exam or entrance exam.
– Anyone who is preparing for entrance examinations and other competitive examinations.
– All Experienced, Freshers and Students.

Here is list of Questions and Answers covering all key area of  Byte And Short Wrappers topic of Java Programming:

 

1.  Which of these methods is not defined in both Byte and Short wrappers?

Answer: Option B

Explanation:
isInfinite() methods is defined in Integer and Long Wrappers, returns true if specified value is an infinite value otherwise it returns false.

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

Answer: Option A

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

3. Which of these is a super class of wrappers Byte and short wrappers?

Answer: Option D

Explanation:
Number is an abstract class containing subclasses Double, Float, Byte, Short, Integer and Long.

4. Which of these methods of Byte wrapper can be used to obtain Byte object from a string?

Answer: Option C

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

5. Which of these exceptions is thrown by compareTo() method defined in double wrapper?

Answer: Option

Explanation:
compareTo() methods compare the specified object to be double, if it is not then ClassCastException is thrown.