Tag: programming languages

Questions Related to programming languages

  1. The invocation of an object's finalize() method is always the last thing that happens before an object is garbage collected (GCed).

  2. When a stack variable goes out of scope it is eligible for GC.

  3. Some reference variables live on the stack, and some live on the heap.

  4. Only objects that have no reference variables referring to them can be eligible for GC.

  5. It's possible to request the GC via methods in either java. lang. Runtime or java.lang.System classes.


Correct Option: C,E
  1. Faster f = Faster.Higher;

  2. Faster f = Better.Faster.Higher;

  3. Better.Faster f = Better.Faster.Higher;

  4. Bigger.Faster f = Bigger.Faster.Higher;

  5. Better. Faster f2; f2 = Better.Faster.Longer;

  6. Better b; b.Faster = f3; f3 = Better.Faster.Longer;


Correct Option: C,E
  1. b = (Number instanceof s);

  2. b = (s instanceof Short);

  3. b = s.instanceof(Short);

  4. b = (s instanceof Number);

  5. b = s.instanceof(Object);

  6. b = (s instanceof String);


Correct Option: B,D