3 ms·
Pretty nice! Makes me wonder why they didn't take the final step and say that anything not inside `void main()` gets bundled up into an implicit function run fi
by johnfn 4y ago
Pretty nice! Makes me wonder why they didn't take the final step and say that anything not inside `void main()` gets bundled up into an implicit function run first.
- djur 4y agoIt's addressed near the end: > Eliminating the main method altogether may seem like the natural next step, but it would work against the goal of gracefully evolving a first Java program to a larger one and would impose some non-obvious restrictions (see below): The "see below" boils down to there being a number of differences between how class-level and method-level code units (fields vs. variables) work, and blurring the line there isn't worth the minor additional effort of writing a main() method.