NEW
Font size
WorksheetsJava Questions & Answers
Total questions: 10
Worksheet time: 5mins
Which of these selection statements test only for equality?
if
switch
if & switch
none of the above mentioned
Which of these are selection statements in Java?
if()
for()
continue
break
Which of this statement is incorrect?
switch statement is more efficient than a set of nested ifs
two case constants in the same switch can have identical values
switch statement can only test for equality, whereas if statement can evaluate any type of boolean expression
it is possible to create a nested switch statements
What will be the output of the following Java program?
1
2
3
4
Which of the following is not a valid jump statement?
break
goto
continue
return
The while loop repeats a set of code while the condition is not met?
True
False
What is it called if an object has its own lifecycle and there is no owner?
Aggregation
Composition
Encapsulation
Association
Method overriding is combination of inheritance and polymorphism?
True
False
Which statement is true about java?
Platform independent programming language
Platform dependent programming language
Code dependent programming language
Sequence dependent programming language
What is the extension of java code files?
.class
.java
.txt
.js
