class Test { static class GenTest { // nested class with static static void oldFunction() { // static method System.out.println("don't use that"); } void newFunction() { // non-static method System.out.println("That's ok."); } } public static void main (String[] args) { GenTest.oldFunction(); // call static method GenTest two = new GenTest(); // call non-static method two.newFunction(); } }
Java Online java