Question 1 of 25
Hints left: 3
Q1
How to get prints of shared object memory maps or heap memory maps for a given process?
Q2
What is the purpose of the "for-each" loop in Java?
Q3
What is the default case in a "switch" statement used for?
Q4
When Overloading does not occur?
Q5
What will be the output of the following Java program? class area { int width; int length; int volume; area() { width=5; length=6; } void volume() { volume = width*length*height; } } class cons_method { public static void main(String args[]) { area obj = new area(); obj.volume(); System.out.println(obj.volume); } }
Q6
Which operator is used by Java run time implementations to free the memory of an object when it is no longer needed?
Q7
What is the output of the following code snippet? int x = 5; if (x > 3) { System.out.println("Hello"); }
Q8
Which of the following is not a valid comparison operator in Java?
Q9
Which of these data types is used by operating system to manage the Recursion in Java?
Q10
What is the purpose of the "switch" statement in Java?
Q11
What is the result of the following code snippet? int i = 1; while (i <= 5) { System.out.print(i + " "); i++; }
Q12
Which of the following is a method having same name as that of its class?
Q13
What is the extension of java code files?
Q14
Which method can be defined only once in a program?
Q15
In Java, which loop is suitable when you want to execute a block of code a specific number of times?
Q16
Which of the following is true about the "do-while" loop in Java?
Q17
In Java, what does the "default" keyword refer to in a "switch" statement?
Q18
In Java, what does the "break" statement do in a loop?
Q19
In Java, which statement is used to exit a loop prematurely?
Q20
In Java, what does the "continue" statement do?
Q21
What happens to the thread when garbage collection kicks off?
Q22
What is the output of the following code snippet? int j = 0; while (j < 5) { System.out.print(j + " "); j += 2; }
Q23
What will be the output of the following Java program? class recursion { int fact(int n) { int result; if (n == 1) return 1; result = fact(n - 1) * n; return result; } } class Output { public static void main(String args[]) { recursion obj = new recursion() ; System.out.print(obj.fact(1)); } }
Q24
What is the purpose of the "if" statement in Java?
Q25
Which of these is not a correct statement?