second type the coding and save as .java third open cmd to compile # set the patch (cd\) # then type (setvar) because the patch file in c folder # open the java folder (cd c:\program files\java) # check all the files inside the folder (dir) # create a .class file for .java file that we save (javac filename.java) #if cannot type (jdk1.7.0\bin)then follow the javac filename.jav a # then compile to output (java filename) fourt see the output