Static Inner Class in Java


Source Code

//Static Inner Class
class OuterClass {
    static int x=10;
    int y=20;
    static class InnerClass
    {
        void display()
        {
            System.out.println("X : "+x);
        }
    }
}
 
public class staticInnerClass {
    public static void main(String[] args) {
        OuterClass.InnerClass i =new OuterClass.InnerClass();
        i.display();
    }
}
 
To download raw file Click Here

Basic Programs



Learn All in Tamil © Designed & Developed By Tutor Joes