|
|
|
|
My first Java programType 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. Sourceimport java.util.* ; public class Hello { 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. |
|
Send mail to arungomes@eircom.net with questions or comments about this web site.
|