Java Programming Questions and Answers
Which of these array declarations and initializations are legal?
Which of these statements is illegal.
Given a one dimensional array arr, what is the correct way of getting the number of elements in arr. Select the one correct answer
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));
}
}