Opening Hours :7AM to 9PM
class ClassName // outer class { class ClassName // inner class { //methods and fields ... ... } //methods and fields ... ... }
class A { int x; class B { int y; float z; void f1() { Statement 1; Statement 2; .. .. } ... ... } }
class A { int x=10; void f1() { System.out.println("this if f1 method"); } void f2() { B ob=new B(); ob.f4(); } class B { int y=30; void f3() { System.out.println("x="+x); f1(); } void f4() { System.out.println("this is f4 method"); } }; static class C { void f5() { System.out.println("this is f5 method"); } } }; public class Rain { public static void main(String[] args) { A oa=new A(); oa.f2(); A.B ob=new A().new B();// non static inner class object ob.f3(); A.C oc=new A.C(); // static inner class object oc.f5(); } }