Results 1 to 6 of 6
  1. #1
    Phantom is offline Member
    Join Date
    Sep 2008
    Posts
    1
    Rep Power
    0

    Question Help with "Hello World" Program

    Hi, this is my third day of java programming. Im trying to make the "hello world" program as my very first program and im having some problems. I made this program in school and it worked but i dont know why its not working on my own PC.

    Heres the code
    Java Code:
    /**
     * @(#)Hello.java
     *
     *
     * @author 
     * @version 1.00 2008/9/4
     */
    
    
    public class Hello 
    {
    
        public static void main (string[] args)
        {
       system.out.println ("Hello");
        }
        
        
        
    }
    errors:
    cannot find symbol class string line 13
    package system does not exist line 15

  2. #2
    Eku
    Eku is offline Senior Member
    Join Date
    May 2008
    Location
    Makati, Philippines
    Posts
    234
    Rep Power
    7

    Default

    change string[] to String[]
    Mind only knows what lies near the heart, it alone sees the depth of the soul.

  3. #3
    hardwired's Avatar
    hardwired is offline Senior Member
    Join Date
    Jul 2007
    Posts
    1,576
    Rep Power
    8

    Default

    errors:
    cannot find symbol class string line 13

    As Eku wrote.

    package system does not exist line 15
    Change system.out.println to System.out.println

  4. #4
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    19

    Default

    Here is the correct code. Keep in mind that Java is case-sensitive.

    Java Code:
    /**
     * @(#)Hello.java
     *
     *
     * @author 
     * @version 1.00 2008/9/4
     */
    
    
    public class Hello 
    {
    
        public static void main (String[] args)
        {
            System.out.println ("Hello");
        }
        
    }

  5. #5
    Supamagier is offline Senior Member
    Join Date
    Aug 2008
    Posts
    384
    Rep Power
    6

    Default

    The error messages say precisely what's wrong, learn to understand them.
    I die a little on the inside...
    Every time I get shot.

  6. #6
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    19

Similar Threads

  1. Hwlp with "Open", "Save", "Save as..."
    By trill in forum New To Java
    Replies: 3
    Last Post: 11-02-2010, 09:26 AM
  2. Help with "hello world"
    By fogus in forum New To Java
    Replies: 9
    Last Post: 12-29-2008, 10:18 PM
  3. <core:forEach var="" begin="+<%=j%>+">???
    By freddieMaize in forum JavaServer Pages (JSP) and JSTL
    Replies: 1
    Last Post: 09-27-2008, 01:20 AM
  4. "Jumble" or "Scramble" Program
    By Shadow22202 in forum Java Applets
    Replies: 8
    Last Post: 04-30-2008, 03:42 AM
  5. Replies: 1
    Last Post: 07-27-2007, 10:59 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •