interface MyInterface{
public static int num = 100;
public void display();
}
public class InterfaceExample implements MyInterface{
public void display() {
System.out.println("This is the implementation of the display method");
}
public void show() {
System.out.println("This is the implementation of the show method");
}
public static void main(String args[]) {
MyInterface obj = new InterfaceExample();
obj.display();
obj.show(); // how can i call this ?
}
}
Above is some lines of code , I wanted to know can I call show() method of InterFaceExample class using interface object?. Please help.