Guest User

Untitled

a guest
Jan 19th, 2019
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. public interface MainInterface {
  2. public void method1();
  3. public void method2();
  4. }
  5.  
  6. void testMethod() {
  7. methodMain(new MainInterface() {
  8.  
  9. @Override
  10. public void method1() {
  11. System.out.println("This is method1");
  12. }
  13.  
  14. @Override
  15. public void method2() {
  16. System.out.println("This is method2");
  17. }
  18. });
  19. }
  20.  
  21. void methodMain(MainInterface mi) {
  22. mi.method1();
  23. mi.method2();
  24. }
Add Comment
Please, Sign In to add comment