WorksheetsJava variables
Total questions: 10
Worksheet time: 18mins
0
Garbage value
Compilation error
Runtime error
0
Garbage value
Compilation error
Runtime error
The instance variables in b are given the same values as a
The instance variables in a are given the same values as b
a and b are considered to be the same object
None of the mentioned options
A single class can have
only one instance
two instances
any number of instances
None of the mentioned options
Static means
Class Level
Object level
Main method is static because to execute main method without creating object By JVM
Yes
No
What is the ouput of the following code?
x=10 x=10
x=10 x=20
x=30 x=30
x=30 x=20
Given that Student is a class, how many reference variables and objects are created by the following code?
Three reference variables and two objects are created.
Two reference variables and two objects are created.
One reference variable and two objects are created.
Three reference variables and three objects are created.
Which of the following below live on the heap in java?
class
static
method
object
Predict the output.
Compilation Error
20 40 10
20 20 10
20 10 10
