Home > DeveloperSection > Forums > I have started with java but compiler gives erroer
Andrew Watson
Andrew Watson

Total Post:39

Points:273
Posted on    November-12-2014 10:34 PM

 Java Javac 
Ratings:


 1 Reply(s)
 548  View(s)
Rate this:

As you can tell I am just starting out, but I have been told I will probably be good at it

public class HelloWorld {

    public static void main(string[] args) {

        system.out.println("Hello world") ;

    }

}

the compiler says

"HelloWorld.java:3: error: cannot find symbol

    public static void main(string[] args) {

                            ^

  symbol:   class string

  location: class HelloWorld

HelloWorld.java:5: error: package system does not exist

        system.out.println("Hello world") ;

              ^

2 errors"

will somebody please explain to me what is wrong



Chris S
Chris S

Total Post:48

Points:336
Posted on    November-13-2014 12:11 AM

Capitalization is important in this context. The class is String and I believe you need System like

public static void main(String[] args) {

  System.out.println("Hello world") ;

}


Don't want to miss updates? Please click the below button!

Follow MindStick