A Developer Gateway To IT World...

Techie Uncle Software Testing Core Java Java Spring C Programming Operating System HTML 5 Java 8 ES6 Project

Example of Interface

interface CalCulator
{
    //no need to write abstract keyword
    int add(int x, int y);
    //final variable and also no need to write final keyword
    final int id=90;
}
class Calc1 implements CalCulator
{
    //implementing all abstract methods of interface
   public int add(int x, int y)
    {
        return x+y;     
    }  
    public static void main(String args[])
    {
           Calc1 o = new Calc1();
           System.out.println(o.add(10,22));
    }
   

}

LEARN TUTORIALS

.

.