How is this a runtime exception the code should not even compile | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

How is this a runtime exception the code should not even compile

https://www.sololearn.com/post/1327569/?ref=app

15th Oct 2021, 5:57 PM
Adithya Keshav T
Adithya Keshav T - avatar
3 Answers
+ 2
Program compiles fine. But at run time it can't find main method. so runtime exception. That's why it should be public .
15th Oct 2021, 6:01 PM
Jayakrishna 🇮🇳
+ 2
Put your link in the description, not in the question area. It doesn't work.
15th Oct 2021, 5:59 PM
ChaoticDawg
ChaoticDawg - avatar
+ 1
Program compiles well but while execution it will search for main method Since the method mentioned in program looks like main but it is not main method
17th Oct 2021, 4:54 PM
sree harsha
sree harsha - avatar