NEW
Font size
WorksheetsQuiz_Java01
Total questions: 24
Worksheet time: 14mins
BubbleSort
SelectionSort
InsertionSort
None of the above
Local variable which is?
is declared inside the class but outside the method
is declared inside the method
All of the above
What is the output of these statements?
for (int i = 1; i <= 10; ++i) {
System.out.print(i);
}
2345678910
23456789
234567891011
12345678910
Which of the following opinion is TRUE about break and continue statement?
continue leaves a loop, break jumps to the next iteration.
break skips the current iteration of a for, while , or do-while loop
break leaves a loop, continue jumps to the next iteration.
None of the above
012
0123
01234
None of the above
Types of Java Comments include:
Single Line Comment
Multi Line Comment
Documentation Comment
Single Line Comment and Multi Line Comment
All answers are TRUE
BubbleSort
SelectionSort
InsertionSort
None of the above
BubbleSort
SelectionSort
InsertionSort
None of the above
Which opinion is TRUE about naming conventions in java?
class name should start with uppercase letter and be a noun
interface name should start with uppercase letter and be an adjective
method name should start with lowercase letter and be a verb
variable name should start with lowercase letter
All of the Answers
The object cloning is a way to create exact copy of an object?
True
False
1
2
3
4
Prints: 12
Prints: 1,4,7
Prints: 2,5,8
Prints: 3,6,9
Prints: false,false,false
Prints: false,false,true
Prints: false,true,false
Prints: true,false,false
Prints: false,false,false
Prints: false,false,true
Prints: false,true,true
Prints: false,true,false
Prints: 1,true
Prints: 2,true
Prints: 1,false
Prints: 2,false
Prints: 0,0
Prints: 1,0
Prints: 0,1
Prints: 1,1
Prints: 3
Prints: 4
Prints: 5
Prints: 6
Prints: 3,4,8
Prints: 7,2,6
Compile-time error
Run-time error
Prints: 390
Prints: 195195
Prints: 195ab
Prints: ab195
1
2
3
4
Prints: A
Prints: B
Prints: C
Compile error
Prints: ABC
Prints: ABCC
Prints: CBA
Prints: ABCBCC
Prints: 0001
Prints: 012
Prints: 012012
Prints: 012345
Which of the following is not primitive data type?
byte
short
enum
int
