1.
In the following Java program, how many objects are eligible for garbage collection after line 8 runs:
public class TestClass {

    public static void main(String[] args) {

        TestClass obj0 = new TestClass();
        TestClass obj2 = method1(obj0); /* Line 6 */
        TestClass obj4 = new TestClass();
        obj2 = obj4; /* Line 8 */
        doComplexStuff();
    }

    static void doComplexStuff() {

    }

    static TestClass method1(TestClass mx) {
        mx = new TestClass();
        return mx;
    }
}
2.
In the following Java program, when is the Float object, created in line 3, eligible for garbage collection:
public Object m() {
    Object o = new Float(3.14 F);

    Object[] oa = new Object[l];
    oa[0] = o; /* Line 5 */
    o = null; /* Line 6 */
    oa[0] = null; /* Line 7 */
    return o; /* Line 8 */
}
3.
In Java, which of the following is used to destroy an object x?
4.
In Java, prototype of the default constructor is _______________________________.
5.
In Java, the size of the ____________________________ collection class can be increased or decreased but the methods of this class are not synchronized.
6.
In Java, the elements of the ____________________________ collection class are associated with key values and the objects of this class are retrieved in a FIFO sequence.
7.
In Java, which of the following is a reserved keyword?
8.
In Java, which of the following statement is true about the Java hotspot virtual machine?
9.
In Java, which of the following commands is used to create and start this thread:
public class MyThread implements Runnable

{

    public void run() {
        // some code here
    }
}
10.
In Java, synchronization is _____________________________.