Thank you for being a valued part of the CNET community. As of December 1, 2020, the forums are in read-only format. In early 2021, CNET Forums will no longer be available. We are grateful for the participation and advice you have provided to one another over the years.

Thanks,

CNET Support

Resolved Question

I can t compile the "HelloWorld" programme.

Mar 24, 2013 3:38AM PDT

My programme is this:

class HelloWorld {

// main: generate some simple output

public static void main(String[] args) {
System.out.println("Hello, world.");
}
}

This is what appears:

HelloWorld.java:2: cannot find symbol
symbol : class string
location: class HelloWorld
public static void main(string[] args) {
^

Discussion is locked

Bfuel has chosen the best answer to their question. View answer
- Collapse -
Clarification Request
I googled this one.
Mar 24, 2013 4:07PM PDT

Best Answer

- Collapse -
Re: Hello world
Mar 24, 2013 9:18PM PDT

You write "public static void main(String[] args)"
The compiler reports an error in "public static void main(string[] args)"

Since Java-coding is case-dependent, it's an understandable message. The name of the class is String, not string.

By the way, why add this parameter (a String array of arguments) if you don't use it? That's what I call bad programming. It's sufficient to write public static void main().

Kees

- Collapse -
Because they teach it that way. Remember this bad SQL?
Mar 25, 2013 2:40AM PDT
- Collapse -
(NT) What's wrong with that?
Mar 25, 2013 3:20AM PDT
- Collapse -
In short, it creates quite a load on the SQL server.
Mar 25, 2013 3:28AM PDT
- Collapse -
(NT) Thanks, bros.
Mar 25, 2013 5:35AM PDT