College.java

//Parent class
class college{ 
   void bus(){
    System.out.println("It is compulsory");
   }
}
          

super with method

Super is used to refer parent class property

Without using superkeyword:

college.java

class college {
    String name="IIT";
	void display(){
	   System.out.println(name);
	}
}
	  
     

student.java

class student extends college{
    String name="Sam";
	void show(){
	   super.display();
	   System.out.println(name);
    }

    public static void main(String args[]){
      student s=new student();
	  s.show();
	}
}  
     

OUTPUT:
Sam
          

With using super keyword

college.java

class college {
    String name="IIT";
}
          

student.java

class student extends college{
    String name="Sam";
	void show(){
	  System.out.println(super.name);
    }
	
	public static void main(String args[]){
      student s=new student();
	  s.show();
	}	
}
          

OUTPUT:
Sam
          

Address

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