Advertisement
Nicksed

default implementations

Nov 19th, 2021
230
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.38 KB | None | 0 0
  1. interface Jumper {
  2.     default void jump() {
  3.         System.out.println("Jumper jump!");
  4.     }
  5. }
  6.  
  7. interface Tracer {
  8.     default void jump() {
  9.         System.out.println("Tracer jump!");
  10.     }
  11. }
  12.  
  13. class App implements Jumper, Tracer {
  14.  
  15.     public App() {
  16.     }
  17.  
  18.     public static void main(String args[]) {
  19.         App myApp = new App();
  20.         myApp.jump();
  21.     }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement