Method inner class

class college{
    int id=123;
	
	void display(){
      class student{
	    void show(int id){
		    System.out.println(id);
			}
	  }
     student s=new student();
     s.show();
    }
 
  public static void main(String args[]){
    college c=new college();
    c.display();
	}
 }
          

output:
123
          

(adsbygoogle = window.adsbygoogle || []).push({});

Address

Plot number-56/1
Near Gurudwara
LandMark :
Opposite A.N.D college
Govindpuri Metro station
New Delhi
Mobile number:
8826034620