Please tell me the main method doesn't have to be inside a class?
1 answer
Must, this condition can not be violated. No matter what class, at least one main()
function should be.
- And if I have for example a parent (main) class and a successor, can I write the main method only in the parent class in this case? - Muscled Boy
- 3@MuscledBoy in any. - Nofate ♦
- and why? Explain, please? - Muscled Boy
- one@MuscledBoy because the creators of the language so decided, making the maximum object-oriented. - D-side
- thanks for your reply - Muscled Boy
|
public static void main(String[] args)
method? no, not necessarily. - zRrr