//Interface Example
interface InterfaceDemo
{
public void show();
public int display();
}
class A implements InterfaceDemo
{
public void message(int num)
{
System.out.println("Message method..."+num);
}
public void show()
{
System.out.println("show method...");
}
public int display()
{
System.out.println("display method...");
return(0);
}
}
class InrterfaceExample
{
public static void main(String jj[])
{
A a=new A();
a.message(5);
a.show();
a.display();
}
}
Output:-
No comments:
Post a Comment