Now we will use Notepad to write a simple application,HelloWorld and execute it




• Create a text file with content as below:


 "Hello


• Save file with same name of the class and .java extension. In this case,file name is HelloWorld.java
• Compile the source code


Open the Command console window:
1. Press Start button
2. click Run…
3. Type cmd and press OK. This will display a screen similar to the one below
 


"command


Jump to the folder storing the source code file


 "visualbuilder


Use the javac command with input is the source code file name to compile


 "javac


This output console above shows that no error occurred during compiling code. After compiling code,you also can see into the source folder for the new file created with name as HelloWorld.class


• Run the compiled code,type the command java with input is name of the class file. You will see result as below,the greet Hello Java World is printed out:


"print



                    

Copyright © 2010 VisualBuilder. All rights reserved