Sample code JDK 21 project
Answered
As a teacher I'm very glad with JDK 21's feature of the simplified main method: “void main()” instead of “public static void main(String[] args)”, no class required. Now I don't have to explain anymore on day 1 of my class what class, public, static, and String[] args are.
However, when I create a new project in IntelliJ (with JDK 21) and I tick “Add sample code” the resulting Main class still contains the old-fashioned main, embedded in a class. The alternative is also bad: don't tick sample code but create a new Java class, delete “public class …”, and type “void main()”.
Any ideas how I can let my students create projects with as little cognitive overload as possible?
Floris
Please sign in to leave a comment.
can you create a feature request at [https://youtrack.jetbrains.com/newIssue?project=IDEA](https://youtrack.jetbrains.com/newIssue?project=IDEA) and paste the link here? Then I'll help assign it to the right team.
I created this request.
Thanks!