/* * NewMain.java * * Created on July 13, 2005, 12:12 PM * * To change this template, choose Tools | Options and locate the template under * the Source Creation and Management node. Right-click the template and choose * Open. You can then make changes to the template in the Source Editor. */ package examples.advanced; /** * * @author Lubo */ public class NewMain { /** Creates a new instance of NewMain */ public NewMain() { Inner i = new Inner(); System.out.println(i.getOne()); Inner.In ii = i.getInInstance(5); System.out.println(ii.getVal()); } /** * @param args the command line arguments */ public static void main(String[] args) { new NewMain(); } public class Inner { public Inner() { System.out.println("inner"); } public int getOne() { In i = new In(); return i.getOne(); } public In getInInstance(int i) { return new In(i); } public class In { public int inner_val; { inner_val = 0; } public In() { System.out.println("inner.In"); } public In(int i) { inner_val = i; } public int getOne() { return 1; } public int getVal() { return inner_val; } } } }