WorksheetsJAVA QUIZ
Total questions: 11
Worksheet time: 6mins
Will this code compile?
Yes
No
Will this code compile without error?
Yes
No
Will this code compile?
Yes
No
What will happen when you run and compile the following code?
1
0
compilation error
runtime error
What will happen when you run and compile the following code?
Hello
Compilation error
Runtime error
None of the above
What will happen when you run and compile the following code?
Hi
Compilation error
No output
Runtime error
Which class has defined the equals(object o) method?
String
Object
Main
System
What will happen when you compile and run the following code?
Int version
Long version
Compilation error
Runtime error
Which statement is true for the following code?
The code will compile without changes.
The code will compile if public tree{} {Plant{}:} is added to the tree class
The code will compile if public tree{} {tree{}:} is added to the Plant class
The code will compile if public plant{} {this {"fern"}:} is added to the Plant class
what will be the result of the following code?
Int long
Short long
Compilation fails
An exception is thrown at the runtime
Which three methods, inserted individual at line 14, will correctly complete class 2
Int foo{}{/*more code here*/.}
Void foo{}{/*more code here*/.}
Public void foo{}{/*more code here*/.}
Private void foo{}{/*more code here*/.}
Protected void foo{}{/*more code here*/.}
