Can I run a java program without main() method?
if yes then how?
Answers
Answered by
1
Answer:
Yes You can compile and execute without main method By using static block. But after static block executed (printed) you will get an error saying no main method found.
...
Yes, sequence is as follows:
- jvm loads class.
- executes static blocks.
- looks for main method and invokes it.
Explanation:
please mark me as brainliest
Similar questions
Social Sciences,
1 day ago
Biology,
1 day ago
Geography,
2 days ago
English,
2 days ago
Social Sciences,
8 months ago
Physics,
8 months ago