0

Why this code not running pls

package csc; public class Main { public static void main(String[] args) { System.out.println("Hello-World"); } }

22nd Jul 2021, 3:31 PM
Ojukwu Franklin Ifeanyi
Ojukwu Franklin Ifeanyi - avatar
2 Answers
+ 1
Sololearn code playground has no idea about what "package csc;" is that's why it throwing an error. Read about java package.
22nd Jul 2021, 3:33 PM
minirkk
minirkk - avatar
0
Warning: File ./Main.class does not contain class Main Error: Could not find or load main class Main Caused by: java.lang.NoClassDefFoundError: csc/Main (wrong name: Main) As you can see by your error, you're trying to access a package that doesn't exist on their server. Remove that line and you'll be fine.
22nd Jul 2021, 3:35 PM
Jakko Jak
Jakko Jak - avatar