// File: TestLocal.java (Module 10) // // Author: Rahul Simha // Created: Nov 2, 1998 // // A non-static member class cannot be // instantiated by itself. class A { class B { int x; // Data. public B (int i) { // Constructor. x = i; } public void print () // A method. { System.out.println ("B: x=" + x); } } } public class TestLocal { public static void main (String[] argv) { A.B b = new A.B (1); // Does not compile. b.print(); } }