First Java Program from Command Prompt
[1] Open Notepad and type java program. Save into c:\sunilos folder with file name HelloNotepad.java. Do remember your file name and class name must be same.
[2] Open command prompt by Start->Run -> cmd command and go to root c:\
[3] Go to c:\sunilos folder and compile program with help of javac HelloNotepad.java
[4] It will create HelloNotepad.class file in the same folder.
[5] Now execute program with help of java HelloNotepad Console output will be >Hello Notepad