fork(2) 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 Test {
  9.  
  10. static class GenTest { // nested class with static
  11.  
  12. static void oldFunction() { // static method
  13. System.out.println("don't use that");
  14. }
  15. void newFunction() { // non-static method
  16. System.out.println("That's ok.");
  17. }
  18. }
  19.  
  20. public static void main (String[] args) {
  21. GenTest.oldFunction(); // call static method
  22.  
  23. GenTest two = new GenTest(); // call non-static method
  24. two.newFunction();
  25. }
  26.  
  27. }
Success #stdin #stdout 0.1s 27860KB
stdin
Standard input is empty
stdout
don't use that
That's ok.