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. class Foo {
  8. protected Foo() {
  9.  
  10. }
  11.  
  12. public static Foo getFoo() {
  13. return new Foo();
  14. }
  15. }
  16.  
  17. class Bar extends Foo {
  18. public Bar() {
  19. super();
  20. }
  21.  
  22. public static Bar getBar() {
  23. return new Bar();
  24. }
  25. }
  26.  
  27. /* Name of the class has to be "Main" only if the class is public. */
  28. class Ideone
  29. {
  30. public static void main (String[] args) throws java.lang.Exception
  31. {
  32. System.out.println("yay");
  33. }
  34. }
Success #stdin #stdout 0.06s 380160KB
stdin
Standard input is empty
stdout
yay