Created
September 23, 2021 07:08
-
-
Save thomasdarimont/4a6e01cb4c793caf63c01561c16497a5 to your computer and use it in GitHub Desktop.
public static void main inside local classes with Java 17
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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