How To forum

Resolved Question

I can t compile the "HelloWorld" programme.

by Bfuel / March 24, 2013 3:38 AM 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: cannot find symbol
symbol : class string
location: class HelloWorld
public static void main(string[] args) {

Bfuel has chosen the best answer to their question. View answer
Answer This Ask For Clarification
Discussion is locked
You are posting a reply to: I can t compile the "HelloWorld" programme.
The posting of advertisements, profanity, or personal attacks is prohibited. Please refer to our CNET Forums policies for details. All submitted content is subject to our Terms of Use.
Track this discussion and email me when there are updates

If you're asking for technical help, please be sure to include all your system info, including operating system, model number, and any other specifics related to the problem. Also please exercise your best judgment when posting in the forums--revealing personal information such as your e-mail address, telephone number, and address is not recommended.

You are reporting the following post: I can t compile the "HelloWorld" programme.
This post has been flagged and will be reviewed by our staff. Thank you for helping us maintain CNET's great community.
Sorry, there was a problem flagging this post. Please try again now or at a later time.
If you believe this post is offensive or violates the CNET Forums' Usage policies, you can report it below (this will not automatically remove the post). Once reported, our moderators will be notified and the post will be reviewed.
Collapse -
Clarification Request
I googled this one.
by R. Proffitt Forum moderator / March 24, 2013 4:07 PM PDT

All Answers

Best Answer chosen by Bfuel

Collapse -
Re: Hello world
by Kees_B Forum moderator / March 24, 2013 9:18 PM 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().


Collapse -
Because they teach it that way. Remember this bad SQL?
by R. Proffitt Forum moderator / March 25, 2013 2:40 AM PDT
In reply to: Re: Hello world
Collapse -
(NT) What's wrong with that?
by Kees_B Forum moderator / March 25, 2013 3:20 AM PDT
Collapse -
In short, it creates quite a load on the SQL server.
by R. Proffitt Forum moderator / March 25, 2013 3:28 AM PDT
Collapse -
(NT) Thanks, bros.
by Bfuel / March 25, 2013 5:35 AM PDT
In reply to: Re: Hello world
Popular Forums
Computer Help 49,613 discussions
Computer Newbies 10,349 discussions
Laptops 19,436 discussions
Security 30,426 discussions
TVs & Home Theaters 20,308 discussions
Windows 10 360 discussions
Phones 15,802 discussions
Windows 7 7,351 discussions
Networking & Wireless 14,641 discussions

CNET Holiday Gift Guide

Looking for great gifts under $100?

Trendy tech gifts don't require a hefty price tag. Choose from these CNET-recommended useful and high-quality gadgets.