Review Questions |
8.1 |
Which statement is true?
Select the one correct answer.
|
8.2 |
Identify the location in the following program where the object, initially referenced with arg1, is eligible for garbage collection.
public class MyClass { public static void main(String[] args) { String msg; String pre = "This program was called with "; String post = " as first argument."; String arg1 = new String((args.length > 0) ? "'" + args[ 0 ] + "'" : "<no argument>"); msg = arg1; arg1 = null; // (1) msg = pre + msg + post; // (2) pre = null; // (3) System.out.println(msg); msg = null; // (4) post = null; // (5) args = null; // (6) } } Select the one correct answer.
|
8.3 |
Which statement is true?
Select the one correct answer.
|
8.4 |
Which statement is true?
Select the one correct answer.
|
8.5 |
Which statement describes guaranteed behavior of the garbage collection and finalization mechanisms?
Select the one correct answer.
|