Tag: technology

Questions Related to technology

  1. The instance gets garbage collected.

  2. The code on line 33 throws an exception

  3. The code on line 35 throws an exception.

  4. The code on line 31 throws an exception

  5. The code on line 33 executes successfully.


Correct Option: B,C,E
  1. assert value == null;

  2. assert value != null, "value is null";

  3. if (value == null) {throw new AssertionException("value is null");}

  4. if (value == null) {throw new IllegalArgumentException("value is null");}


Correct Option: D
  1. Compilation fails.

  2. Pi is approximately 3.

  3. Pi is approximately 3.141593.

  4. An exception is thrown at runtime.


Correct Option: D