Question 37 :
How many objects will be eligible for garbage collection after the execution of line 9 in the following code?
How many objects will be eligible for garbage collection after the execution of line 9 in the following code?
Choose one answer.
a. 8
b. 14
c. 15
d. 16
a. 8
b. 14
c. 15
d. 16
Question 38 :
What will be the result of compiling the following programs and executing it using the following command - java Child?
What will be the result of compiling the following programs and executing it using the following command - java Child?
Choose one answer.
a. Prints 9
b. Compiler error at line 5
c. Compiler error at line 6
d. None of the above
a. Prints 9
b. Compiler error at line 5
c. Compiler error at line 6
d. None of the above
Question 39 :
Which of the following is the most appropriate code snippet that can be inserted at line 3?
Choose one option
a. assert ((0 < frequency) && (frequency <=60));
b. assert ((0 < frequency) && (frequency <=60)) : "Frequency out of range";
c. if(frequency <= 0 || frequency > 60)
throw new IllegalArgumentException("Frequency out of range");
d. if(frequency <= 0 || frequency > 60)
throw new Exception("Frequency out of range");
e. None of these
a. assert ((0 < frequency) && (frequency <=60));
b. assert ((0 < frequency) && (frequency <=60)) : "Frequency out of range";
c. if(frequency <= 0 || frequency > 60)
throw new IllegalArgumentException("Frequency out of range");
d. if(frequency <= 0 || frequency > 60)
throw new Exception("Frequency out of range");
e. None of these
<<<Previous Page Next Page >>>