1.

public class MyOuter { public static class MyInner { public static void foo() { } }
}
which statement, if placed in a class other than MyOuter or MyInner, instantiates an instance of the nested class?

A. MyOuter.MyInner m = new MyOuter.MyInner();
B. MyOuter.MyInner mi = new MyInner();
C. <p>MyOuter m = new MyOuter();</p>
D. <p>MyOuter.MyInner mi = m.new MyOuter.MyInner();</p>
E. MyInner mi = new MyOuter.MyInner();
Answer» B. MyOuter.MyInner mi = new MyInner();


Discussion

No Comment Found

Related MCQs