3 ms·
> the proposal is to allow for main to be an instance method An instance method of... which instance? Is some invisible, nameless class instantiated with its d
by Traubenfuchs 3y ago
> the proposal is to allow for main to be an instance method
An instance method of... which instance? Is some invisible, nameless class instantiated with its default constructor? How would you acquire this main method via reflection?
- kaba0 3y agoImagine `public class [randomName] {` at the top. If it has a void main() method the class loader (not the spec!) will do new [randomName].main() You won’t acquire this main via reflection because why would you do so? It is for teaching, and one-off scripts. Later on you can trivially add that single line and name your class.