java.lang Package Interview Questions And Answers

Here are the java.lang package interview questions and answers with the PDFs to download. All questions are in form of MCQ
1. Which of the following class is not included in java.lang?

[A] Byte
[B] Integer
[C] Array
[D] Class
Loading...
2. 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.
Loading...
3. Which of these is a super class of wrappers Double & Integer?
[A] Long
[B] Digits
[C] Float
[D] Number
Loading...
4. Which of these is wrapper for simple data type float?
[A] float
[B] double
[C] Float
[D] Double
Loading...
5. Which of these methods is used to check for infinitely large and small values?
[A] isInfinite()
[B] isNaN()
[C] Isinfinite()
[D] IsNaN()
Loading...
6. What is the output of this program?


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
Loading...
7. What is the output of this program?


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
Loading...
8. What is the output of this program?


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
Loading...
9. Which of these operators can be used to concatenate two or more String objects?
[A] +
[B] +=
[C] &
[D] ||
Loading...
10. Which of these method of class String is used to obtain length of String object?
[A] get()
[B] Sizeof()
[C] lengthof()
[D] length()
Loading...
Are these questions helpful for you?

Comments: (Your feedback is valuable to us)