Java Programming Questions and Answers
Which of the following class is not included in java.lang?
Which of these is a process of converting a simple data type into a class?
Which of these is a super class of wrappers Double & Integer?
Which of these methods is used to check for infinitely large and small values?
What is the output of this program?
classisinfinite_output{
publicstaticvoidmain(String args[]){
Double d = new Double(1 / 0.);
boolean x = d.isInfinite();
System.out.print(x);
}
}
What is the output of this program?
classisNaN_output{
publicstaticvoidmain(String args[]){
Double d = new Double(1 / 0.);
boolean x = d.isNaN();
System.out.print(x);
}
}
What is the output of this program?
classbinary{
publicstaticvoidmain(String args[]){
int num = 17;
System.out.print(Integer.toBinaryString(num));
}
}
Which of these method of class String is used to obtain length of String object?
Which of these operators can be used to concatenate two or more String objects?
Which of these methods is used to obtain value of invoking object as a long?