Java program for accessing interface methods

interface A 

{

void m1();

}

class C implements A

{

public void m1()

{

System.out.println("m1 is called");

}

void m2()

{

System.out.println("m2 is called");

}


}

class Demo 

{

public static void main(String ar[])

{

C ob;

ob=new C();

ob.m1();

ob.m2();

}



OUTPUT
















Comments