Chapter 1

Home Up Contents Job Links Download
[ Chapter 1 ] Hot Java Links ]

Search this site(enter key word):  

Helping the mankind

 

 

My first Java program

Type the following code ( or copy and paste ) into a text file and save as "Hello.java".  You have to explicitly give the extension .java and the file name should match the class name you are creating.  Remember it is case sensitive.

TIPS: Through out this on-line learning programme for all languages you can click on the source linke to download the source code (ZIP format) to your machine.  You can also right-click on the link and select Save target As option.

Source

import java.util.* ;

public class Hello {
    public static void main( String args[] ) {
        System.out.println( "OOPS! It is a good start!!! ) ;
    }
}

To compile your first program type the following command from the DOS prompt.

javac Hello.java

Hello.class will be created if there is no error.  To run your program type the following command:

java Hello.class

or

java Hello

You will see the message displayed.

Have you enjoyed your first java program.

 

 

Home ] Up ]

Sign My Guestbook Guestbook by GuestWorld Sign My Guestbook

Join EITC's mailing list!
Enter your email address below,
then click the 'Join List' button:
Powered by ListBot

Send mail to arungomes@eircom.net with questions or comments about this web site.
Copyright © 1999 Empire Cyber IT Consultancy
Last modified: January 04, 2000