JEP 445: Flexible Main Methods and Anonymous Main Classes (Preview)
My 2¢ is that this will probably do more to confuse than to enlighten students.<p>Getting your &quot;first&quot; program off the ground quickly is good, but only if it doesn&#x27;t cripple your understanding of what&#x27;s going on for months later.<p>For me the main thing that confuses the crap out of students is how people who introduce java tend to take &quot;shortcuts&quot; and bundle all functionality under the sun into a single class, which then also has a main method at the end. Presumably this is done so that everything is a single file, or can fit in a single presentation slide. But then suddenly your main looks like it&#x27;s calling its container class to make objects of &quot;itself&quot; that contain new &quot;mains&quot;, at which point your student has lost the plot completely.<p>The simplest thing to keep things clean and self explanatory is to separate everything that isn&#x27;t &quot;main-related&quot; into its own class (preferably another file if public), and then keep a nice clean public class called &quot;Main&quot; which contains &#x27;only&#x27; the main method. Then you get to explain nicely how public classes have their own files, and if you attempt to run this class from the terminal, java will look for the &#x27;main&#x27; function, and how this therefore needs to be public, static because you&#x27;re running it straight from the class, void because you don&#x27;t depend on it returning a value (which also makes for a nice intermission on how c returns status as an int, but java has a special mechanism instead).<p>I do agree with the end of the JEP though; if you want to teach simple snippets like System.out.println, jshell is a nice way to do this, if you want to delay talking about classes and their methods.