Which of the following code fragments shows the correct way to declare and initialize a reference to a NestedClass object from outside NormalClass? : Questions « Object Oriented « SCJP
class NormalClass {
NormalClass() {
}
staticclass NestedClass {
NestedClass() {
}
}
}
A. NormalClass.NestedClass myNC = new NormalClass.NestedClass();
B. NestedClass myNC = new NormalClass().new NestedClass();
C. NestedClass myNC = new NormalClass.NestedClass();