Callback.java
interface
Callback
{
public void call(int param);
}
Client.java
class
Client implements Callback
{
public void call(int p)
{
System.out.println("Interface Method = " + p);
}
public void nonIfaceMeth()
{
System.out.println("Non
Interface method is also used");
}
public static void main(String args[])
{
Callback c = new Client();
c.call(5);
// c.nonIfaceMeth();
}
}
No comments:
Post a Comment