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 Foo
  9. {
  10. public static void main (String[] args) throws java.lang.Exception
  11. {
  12. Baz.helloWorld();
  13. }
  14.  
  15. public void Foo(){}
  16. }
  17.  
  18. class Baz extends Foo
  19. {
  20. public String foo;
  21. private void Baz(){
  22. foo = "hello";
  23. }
  24. public static void helloWorld() {
  25. Baz baz = new Baz();
  26. System.out.println(baz.foo);
  27. }
  28. }
Success #stdin #stdout 0.11s 320576KB
stdin
Standard input is empty
stdout
null