0

My code is not working . Plz help me with this

https://code.sololearn.com/cN8FXu9Vd9US/?ref=app

12th Nov 2020, 12:54 PM
Arihant Kumar
Arihant Kumar - avatar
5 Answers
+ 5
Arihant Kumar Pls learn the Java lesson carefully. Every program starts executing from the main method. U haven't written it in ur program.
12th Nov 2020, 12:59 PM
Alphin K Sajan
Alphin K Sajan - avatar
+ 5
Arihant Kumar Read this carefully: https://www.sololearn.com/learn/Java/2137/ It is clearly defined and highlighted in this lesson that "Every Java program starts from the main method". So u need to include it in all ur programms. Hope that helps....
12th Nov 2020, 1:02 PM
Alphin K Sajan
Alphin K Sajan - avatar
+ 2
You don't have a main method declared. your main method should look like this: public static void main(String[] args) { //your code }
12th Nov 2020, 12:55 PM
pNK
pNK - avatar
0
Plz explain
12th Nov 2020, 12:56 PM
Arihant Kumar
Arihant Kumar - avatar
0
Arihant Kumar in java your program starts and ends at your main method, so if you don't have a proper main method declared, it won't know what to do. Hence you are getting an error
12th Nov 2020, 12:59 PM
pNK
pNK - avatar