Interface:

interface as solution --> abstraction and inheritance
interface allow--> multiple inheritance
interface allow---> single method acces as it is supported by multiple inheritance

Syntax

interface  anyname{
	      void methodanyname();
	}		  
          

compiler treat as interface method as:

interface  anyname{
	    public abstract  void methodanyname();
}
          

As per above code, method in interface by default abstract method.

child class access interface by using ----> implements keyword
child class access multiple interface by using--->implements interface1,interface2/
child class must implement method of interface class

interface access another interface by using --->extends keyword
class access interface by using --->implements keyword

interface transport{
    void bus();
}

interface payment{
     void online();
}

 class college  implements transaction{
     public void bus(){
	   System.out.println("student should travel by bus");
	   }
  public static void main(String args[]){
     college c=new  college();
	 c.bus();
	 }
	}
	
          

output:
    student should travel by bus	
          

Multiple interface:

interface transport{
    void bus();
}

interface payment{
     void online();
}

 class college transport,payment{
     public void bus(){
	   System.out.println("student should travel by bus");
	   }
	   
	   public void online(){
	   System.out.println("all transaction take place by online");
	   }
  public static void main(String args[]){
     college c=new  college();
	 c.bus();
	 c.online();
	 }
	}
	
	
          

output:
 student should travel by bus
 all transaction take place by online
	
          

one interface extends another interface

interface transport{
    void bus();
}

interface payment extends transport{
     void online();
}

 class college payment{
     public void bus(){
	   System.out.println("student should travel by bus");
	   }
	   
	   public void online(){
	   System.out.println("all transaction take place by online");
	   }
  public static void main(String args[]){
     college c=new  college();
	 c.bus();
	 c.online();
	 }
	}
	
	
          

output:
 student should travel by bus
 all transaction take place by online
	
          

Address

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