"Compiler Exit Status 1"
Here is my code project for school. I made sure to do everything right, but I still get the same error. Can someone please explain to me what I'm doing wrong?
Voters
EpicGamer007
Ok , u did what Six and Coder said. Just so you know, there can only be 1 public static void main(String[] args)
. If you wanna fix this, change the public static void main(String[] args)
in SammysMotto2
to public SammysMotto2
Coder100
Have you tried:
Main.java
class Main { public static void main(String[] args) { SammysMotto2.main(); } }
and then for SammysMotto2.java
:
class SammysMotto2 { public static void main() { System.out.println("SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS"); System.out.println("S Sammy's makes it fun in the sun S"); System.out.println("SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS"); } }
TheMaster7661
@Coder100 I have tried your ideas, but I still get the same error. maybe you can try to explain what my error means?
Coder100
@NoahJospeh why are you not calling it as
main
? SammysMotto2
is a class, and it's a static class so that means there is no constructor. You are going to have to, in your code, have: SammysMotto2.main();
insteadCoder100
it appears you didn't change anything too btw
@NoahJospehSixBeeps
Replace Line 3 of Main.java to SammysMotto2.main(args);
TheMaster7661
@SixBeeps I did what you said, but I still have the same error, am I doing it wrong?
Thank you, everyone, I fixed it, and it now works!