Example program not working | Sololearn: Learn to code for FREE!
Neuer Kurs! Jeder Programmierer sollte generative KI lernen!
Kostenlose Lektion ausprobieren
+ 1

Example program not working

when I pressed javac example program.java in commandpromt it automatically went to next line after that I pressed java exampleprogram as they said in tutorial and it came a error "could not find main class exampleprogram " this was the error

5th Apr 2017, 10:06 AM
Naredla Ajay (Channel A)
Naredla Ajay (Channel A) - avatar
7 Antworten
+ 5
Make sure that public class name containing main () and your .java filename are the same. File name: exampleprogram.java Content: public class exampleprogram{ public static void main (String [] args){ //to do } }
5th Apr 2017, 10:17 AM
ą¤¦ą„‡ą¤µą„‡ą¤‚ą¤¦ą„ą¤° ą¤®ą¤¹ą¤¾ą¤œą¤Ø (Devender)
ą¤¦ą„‡ą¤µą„‡ą¤‚ą¤¦ą„ą¤° ą¤®ą¤¹ą¤¾ą¤œą¤Ø (Devender) - avatar
+ 4
Better you should use Netbeans or Eclipse IDE. They will make your programming more easier
5th Apr 2017, 10:28 AM
ą¤¦ą„‡ą¤µą„‡ą¤‚ą¤¦ą„ą¤° ą¤®ą¤¹ą¤¾ą¤œą¤Ø (Devender)
ą¤¦ą„‡ą¤µą„‡ą¤‚ą¤¦ą„ą¤° ą¤®ą¤¹ą¤¾ą¤œą¤Ø (Devender) - avatar
+ 3
šŸ˜‚šŸ˜Žthat part was left for you dearšŸ¤”
5th Apr 2017, 10:21 AM
ą¤¦ą„‡ą¤µą„‡ą¤‚ą¤¦ą„ą¤° ą¤®ą¤¹ą¤¾ą¤œą¤Ø (Devender)
ą¤¦ą„‡ą¤µą„‡ą¤‚ą¤¦ą„ą¤° ą¤®ą¤¹ą¤¾ą¤œą¤Ø (Devender) - avatar
+ 1
u missed the line System.out.println("helloworld");
5th Apr 2017, 10:19 AM
Naredla Ajay (Channel A)
Naredla Ajay (Channel A) - avatar
0
so why iam not getting
5th Apr 2017, 10:21 AM
Naredla Ajay (Channel A)
Naredla Ajay (Channel A) - avatar
0
when I saved it as a .java I could not open it it says windows can't open file
5th Apr 2017, 10:22 AM
Naredla Ajay (Channel A)
Naredla Ajay (Channel A) - avatar
0
thank you devender mahajan
5th Apr 2017, 10:28 AM
Naredla Ajay (Channel A)
Naredla Ajay (Channel A) - avatar