fork download
  1. interface SomeInterface {
  2. default void someMethod() {
  3. System.out.println("Some default method");
  4. }
  5. }
  6.  
  7. enum Dp implements SomeInterface {
  8. A,
  9. B,
  10. C {
  11. @Override
  12. public void someMethod() {
  13. System.out.println("Some other implementation");
  14. }
  15. }
  16. }
  17.  
  18. class Main {
  19. public static void main(String[] args) {
  20. Dp.A.someMethod();
  21. Dp.B.someMethod();
  22. Dp.C.someMethod();
  23. }
  24. }
Success #stdin #stdout 0.08s 46940KB
stdin
Standard input is empty
stdout
Some default method
Some default method
Some other implementation