fork download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6.  
  7. /* Name of the class has to be "Main" only if the class is public. */
  8. class Ideone
  9. {
  10. static interface Foo {
  11. public void foo();
  12. }
  13. static class Bar implements Foo {
  14. @Override
  15. public void foo() {
  16. System.out.println("Bar");
  17. }
  18. }
  19. static class Qux implements Foo {
  20. @Override
  21. public void foo() {
  22. System.out.println("Qux");
  23. }
  24. }
  25. public static void main (String[] args) throws java.lang.Exception
  26. {
  27. Foo bar = new Bar();
  28. Foo qux = new Qux();
  29. bar.foo();
  30. qux.foo();
  31. }
  32. }
Success #stdin #stdout 0.12s 320576KB
stdin
Standard input is empty
stdout
Bar
Qux