Skip to content

Instantly share code, notes, and snippets.

@thomasdarimont
Created September 23, 2021 07:08
Show Gist options
  • Save thomasdarimont/4a6e01cb4c793caf63c01561c16497a5 to your computer and use it in GitHub Desktop.
Save thomasdarimont/4a6e01cb4c793caf63c01561c16497a5 to your computer and use it in GitHub Desktop.
public static void main inside local classes with Java 17
package wb.java17;
/**
* <pre>
* javac wb/java17/LocalMain.java
*
* java -cp . 'wb.java17.LocalMain$1Local'
* </pre>
*/
class LocalMain {
public void foo() {
class Local {
public static void main(String[] args) {
System.out.println("hello from foo.Local.main");
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment