Tag: programming languages
Questions Related to programming languages
-
0
-
1
-
2
-
Compilation fails
-
It is not possible to know
-
An exception is thrown at runtime
-
many
-
a few
-
Compilation fails
-
The output is not predictable
-
An exception is thrown at runtime
-
2
-
4
-
An exception is thrown at runtime
-
Compilation fails due to an error on line 4
-
Compilation fails due to an error on line 5
-
Compilation fails due to an error on line 6
-
The invocation of an object's finalize() method is always the last thing that happens before an object is garbage collected (GCed).
-
When a stack variable goes out of scope it is eligible for GC.
-
Some reference variables live on the stack, and some live on the heap.
-
Only objects that have no reference variables referring to them can be eligible for GC.
-
It's possible to request the GC via methods in either java. lang. Runtime or java.lang.System classes.
-
Line 4
-
Line 5
-
Line 6
-
Line 7
-
Line 8
-
Line 9
-
Faster f = Faster.Higher;
-
Faster f = Better.Faster.Higher;
-
Better.Faster f = Better.Faster.Higher;
-
Bigger.Faster f = Bigger.Faster.Higher;
-
Better. Faster f2; f2 = Better.Faster.Longer;
-
Better b; b.Faster = f3; f3 = Better.Faster.Longer;
-
b = (Number instanceof s);
-
b = (s instanceof Short);
-
b = s.instanceof(Short);
-
b = (s instanceof Number);
-
b = s.instanceof(Object);
-
b = (s instanceof String);
-
Only one compilation will succeed.
-
Exactly two compilations will succeed.
-
Exactly three compilations will succeed.
-
All four compilations will succeed.
-
No compiler warnings will be produced.
-
At least one compiler warning will be produced.
-
hi
-
hi hi
-
hi hi hi
-
Compilation fails
-
hi, followed by an exception
-
hi hi, followed by an exception