Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
//First interface
interface Interface1{
public void sayYes();
}
//Second interface extends first interface
interface Interface2 extends Interface1{
public void sayNo();
}
//This class implements interface2 and because it extends from interface1 also implements this one
class Implementation implements Interface2{
public void sayNo() {
System.out.println("No");
}
public void sayYes() {
System.out.println("Yes");
}
}
/*This class simulates your event, returning an Interface2 instance*/
class EventSimulator{
public Interface2 getInterface2(){
return new Implementation();
}
}
public class Application {
public static void main(String[] args) {
EventSimulator event = new EventSimulator();
//I assign an interface2 to an interface1 object
Interface1 result = event.getInterface2();
result.sayYes();
}
}