Given:
public class Main { int id; // w w w. j a v a2s . com Main(int i) { id = i; } public static void main(String[] args) { new Main(3).go(); // commented line } void go() { Main w1 = new Main(1); Main w2 = new Main(2); System.out.println(w1.id + " " + w2.id); } }
When execution reaches the commented line, which are true?
Choose all that apply.
A, B, and G are correct.
The constructor sets the value of id for w1 and w2.
When the commented line is reached, none of the three Main objects can be accessed, so they are eligible to be garbage collected.