I have started with java but compiler gives erroer

Total Post:39

Points:273
Javac 
 1146  View(s)
Ratings:
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

  1. Post:48

    Points:336
    Re: I have started with java but compiler gives erroer

    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") ;
    }

      Modified On Apr-06-2018 05:44:21 AM

Answer