Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public interface MainInterface {
- public void method1();
- public void method2();
- }
- void testMethod() {
- methodMain(new MainInterface() {
- @Override
- public void method1() {
- System.out.println("This is method1");
- }
- @Override
- public void method2() {
- System.out.println("This is method2");
- }
- });
- }
- void methodMain(MainInterface mi) {
- mi.method1();
- mi.method2();
- }
Add Comment
Please, Sign In to add comment