407). Which of these classes is not included in java.lang?
[A]Byte
[B]Integer
[C]Array
[D]Class
Show Answer
Correct Answer: Array
Notes:
Answer: c
Explanation: Array class is a member of java.util.
408). Which of these is a process of converting a simple data type into a class?
[A] type wrapping
[B]type conversion
[C]type casting
[D] none of the Mentioned
Show Answer
Correct Answer: type wrapping
Notes:
Answer: a
Explanation: None.
409). Which of these is a super class of wrappers Double & Integer?
[A]Long
[B]Digits
[C]Float
[D]Number
Show Answer
Correct Answer: Number
Notes:
Answer: d
Explanation: Number is an abstract class containing subclasses Double, Float, Byte, Short, Integer and Long.
410). Which of these is a wrapper for simple data type float?
[A]float
[B]double
[C]Float
[D]Double
Show Answer
Correct Answer: Float
Notes:
Answer: c
Explanation: None.
411). Which of the following is a method of wrapper Float for converting the value of an object into byte?
[A]bytevalue()
[B]byte byteValue()
[C]Bytevalue()
[D]Byte Bytevalue()
Show Answer
Correct Answer: byte byteValue()
Notes:
Answer: b
Explanation: None.
412). Which of these methods is used to check for infinitely large and small values?
[A]isInfinite()
[B] isNaN()
[C]Isinfinite()
[D] IsNaN()
Show Answer
Correct Answer: isInfinite()
Notes:
Answer: a
Explanation: isinfinite() method returns true is the value being tested is infinitely large or small in magnitude.
413). Which of the following package stores all the simple data types in java?
[A]lang
[B]java
[C]util
[D] java.packages
Show Answer
Correct Answer: lang
Notes:
Answer: a
Explanation: None.
414). What will be the output of the following Java code?
class isinfinite_output
{
public static void main(String args[])
{
Double d = new Double(1 / 0.);
boolean x = d.isInfinite();
System.out.print(x);
}
}
[A]0
[B]1
[C]true
[D]false
Show Answer
Correct Answer: true
Notes:
Answer: c
Explanation: isInfinite() method returns true is the value being tested is infinitely large or small in magnitude. 1/0. is infinitely large in magnitude hence true is stored in x.
Output:$ javac isinfinite_output.java
$ java isinfinite_output
true
415). What will be the output of the following Java code?
class isNaN_output
{
public static void main(String args[])
{
Double d = new Double(1 / 0.);
boolean x = d.isNaN();
System.out.print(x);
}
}
[A]0
[B]1
[C]true
[D]false
Show Answer
Correct Answer: false
Notes:
Answer: d
Explanation: isisNaN() method returns true is the value being tested is a number. 1/0. is infinitely large in magnitude, which cannot be defined as a number hence false is stored in x.
Output:
$ javac isNaN_output.java
$ java isNaN_output
false
416). What will be the output of the following Java code?
class binary
{
public static void main(String args[])
{
int num = 17;
System.out.print(Integer.toBinaryString(num));
}
}
[A]1001
[B]10011
[C]11011
[D]10001
Show Answer
Correct Answer: 10001
Notes:
Answer: d
Explanation: None.
output:
$ javac binary.java
$ java binary
10001