Skip to content

Latest commit

 

History

History
30 lines (28 loc) · 542 Bytes

LocalInner.md

File metadata and controls

30 lines (28 loc) · 542 Bytes
layout title parent nav_order
default
Local Inner Class
Inner Class
3

Java Local inner class

Java local inner class example
    public class localInner1{  
     private int data=30;//instance variable  
     void display(){  
      class Local{  
       void msg(){System.out.println(data);}  
      }  
      Local l=new Local();  
      l.msg();  
     }  
     public static void main(String args[]){  
      localInner1 obj=new localInner1();  
      obj.display();  
     }  
    }  

Output

30