Compile Error

FatimahAlkulaib Reply 9 years 10 weeks ago
public class hello { public static void hello (String[] args) { System.out.println("welcome to java !"); } why it is Compile Error ?
pichulia Reply 9 years 10 weeks ago
You should using "Main" class and "main" function in this site.
FatimahAlkulaib Reply 9 years 10 weeks ago
Main.java:1: error: class main is public, should be declared in a file named main.java public class main{ ^ 1 error i did but this is the result .. !!
withcs1 Reply 9 years 10 weeks ago
public class Main is coreect
FatimahAlkulaib Reply 9 years 10 weeks ago
so what is the wrong ?
withcs1 Reply 9 years 10 weeks ago
public class main => public class Main Java language recognizes upper case and lower case are different things.
FatimahAlkulaib Reply 9 years 10 weeks ago
public class Main{ public static void main (String[] args) { System.out.println("welcome to java !"); } } i did like this but tell me wrong answer ㅜㅜ
withcs1 Reply 9 years 10 weeks ago
Welcome to Java! welcome come to java ! First and second line arent same. Computer recognize space (' ') and upper/lowr case