Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public interface Info1 {
- public void method1();
- }
- public interface Info2 extends Info1 {
- public void method2();
- }
- public class Demo implements Info2{
- public void method1() {
- System.out.println("method1");
- }
- public void method2() {
- System.out.println("method2");
- }
- }
- public class Main {
- public static void main(String[] args) {
- Info2 obj = new Demo();
- obj.method2();
- obj.method1();
- Info1 obj1 = new Demo();
- obj1.method1();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement