NEW
Font size
WorksheetsJava_Quiz_Part_2
Total questions: 12
Worksheet time: 11mins
Which of these are selection statements in Java?
if()
for()
break
else
What will be the output of the following Java program?
1
2
3
4
What will be the output of the following Java program?
5
6
14
compilation error
What will be the output of the following Java program?
1 3 5 7
2 4 6 8
1 3 5 7 9
1 2 3 4 5 6 7 8 9
Which of these keywords can be used to prevent inheritance of a class?
super
constant
class
final
Which of the following is a type of polymorphism in Java?
Compile time polymorphism
Execution time polymorphism
Multiple polymorphism
Multilevel polymorphism
What will be the output of the following Java program?
5 6 5 6
5 6 5
Runtime error
Compilation error
Find the output of the following code.
int Integer = 24;
char String = ‘I’;
System.out.print(Integer);
System.out.print(String);
Compile Error
throws exception
l
24 l
What will be the output of the following program?
15 times ***
15 times +++++
8 times *** and 7 times +++++
Both will print only once
What will be the output of the following Java program?
1
2
Runtime error
Garbage value
What will be the output of the following Java program?
0
1
Runtime error
classname@hashcode in hexadecimal form
What will be the output of the following Java code?
5
6
7
8
