Results 1 to 3 of 3
  1. #1
    deeptrance421 is offline Member
    Join Date
    May 2013
    Posts
    2
    Rep Power
    0

    Default Please help. I cant compile it correctly

    I am doing the Hello world tutorial and this is my first program
    This is my code
    Java Code:
    public class MyFirstJavaProgram.java 
    {
    	 public static void main(String []args) 
    	{
    		System.out.printIn("Hello World"); 
    	}
    }
    I am trying to compile it and cmd says:

    '{' expected
    public class MyFirstJavaProgram.java
    with a '^' under the '.'
    I have no idea what i did wrong.
    Any help would be greatly appreciated.
    Last edited by deeptrance421; 05-24-2013 at 02:52 AM.

  2. #2
    jim829 is offline Senior Member
    Join Date
    Jan 2013
    Location
    Northern Virginia, United States
    Posts
    3,777
    Rep Power
    5

    Default Re: Please help. I cant compile it correctly

    What you need is this.

    Java Code:
    public class MyFirstJavaProgram
    
    {
         public static void main(String []args) 
        {
            System.out.println("Hello World"); 
        }
    }
    I changed printIn to println (for print line).
    And it needs to be in a file named "MyFirstJavaProgram.java"

    Regards,
    Jim
    The JavaTM Tutorials | SSCCE | Java Naming Conventions
    Poor planning on your part does not constitute an emergency on my part

  3. #3
    deeptrance421 is offline Member
    Join Date
    May 2013
    Posts
    2
    Rep Power
    0

    Default Re: Please help. I cant compile it correctly

    Thank you so much, Jim.

Similar Threads

  1. Am I understanding this correctly?
    By phixion in forum New To Java
    Replies: 9
    Last Post: 01-27-2011, 05:13 AM
  2. I can't get this to run correctly
    By LostinJavaLand in forum New To Java
    Replies: 4
    Last Post: 07-15-2010, 06:49 AM
  3. Did I do this THREAD correctly?
    By TimHuey in forum New To Java
    Replies: 4
    Last Post: 04-24-2010, 05:54 AM
  4. how to scale correctly ?
    By h9h in forum Java 2D
    Replies: 10
    Last Post: 10-29-2009, 07:06 AM

Posting Permissions

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