What is inner class in java code example

public class Test {
   
        public void MethodOne() {
                System.out.println("Inside Test class");
        }
       
        public class InnerC {
            public void MethodOne() {
                System.out.println("Inside InnerC class");
            }
       
            public void test() {
                this.MethodOne();
                Test.this.MethodOne();
            }
        }
       
        public static void main(String[] args) {       
                Test.InnerC i = new Test().new InnerC();
                i.test();
        }
   
}

Comments

Recent Post

Recent Posts Widget

Popular posts from this blog

Capture image from webcam java code, examples

How to capture finger prints in java

Shallow Copy Deep Copy Java example