Java examples for Object Oriented Design:Inner Class
An inner class called InnerHello in a class called Hello:
public class Hello { class InnerHello { InnerHello () { /*www.j a v a2 s. c o m*/ System .out.println ( "The method call is coming from inside the class!" ); } } public Hello () { // empty constructor } public static void main (String [] arguments) { Hello program = new Hello (); Hello.InnerHello inner = program .new InnerHello (); } }