Help - Search - Members - Calendar
Full Version: Learning /Starting Java programming.
Pixel2Life Forum > Help Section > Desktop Programming
rkhanal
Hi all,

I am new to this
I am not from IT back ground as i work for finance. I read about Java techinology in my office all the time. I am interested to learn Java programming. I have gone through google and just starting to learn how to write " Hello world" in Java programming. I don't know where is my mistake in this little program.

I have named the java file as " Hello.java" as my public class file name is " Hello". Everytime when i try to compile it shows error on the first line of the program. Below is my Hello.java file. It would be very helpful if someone can help me.

==============

Public class Hello

{

// This is my first programming language


Public static void main ( string [] args )

{

// prints the world, Hello World on the screen

System.out.Println (" Hello world" );

}

}



many Thanks,

Ran




dotbart
to help you, you need to help us. What are the error's you're getting?

one thing I noticed is you're using 'Public' instead of 'public' both in your main method and your class definition.


Something that might really help you is Eclipse. It's (in my opinion) the best Java IDE (Integrated Development Environment). with included compiler etc.
I'm sure you can find some info on how to work with it..
rc69
Java is case-sensitive.

Rules you should remember about how to decide which case to put something in:
1. Class names start with a capital letter
2. Keywords/variables/function names start with a lowercase letter.
3. Constants are in all-caps.

CODE
public class Hello{
    // This is my first programming language
    public static void main(string [] args){
        // prints the world, Hello World on the screen
        System.out.println("Hello world");
    }
}
rkhanal
I am still getting the Error :- Can't find symbol- class string. After compiling the code you have provided.
CoryMathews
you just have wrong capitals all over. this code works

CODE
public class hello {
    // This is my first programming language
    public static void main(String[] args) {
        // prints the world, Hello World on the screen
        System.out.println(" Hello world");
    }
}


file name would be hello.java
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.