Compiling and Executing a Java Program using Command Line

Following are the steps to Compile and Execute a Java Program using Command Line.
Suppose we have a file E:\JavaTut\Example.java

a) Make sure you have already installed JDK and set your Path Environment Variable.
b) Open the Command Prompt.
c) Move to E:\JavaTut\
d) Type the following to compile :
    javac Example.java
e) Code will be compiled successfully if it has no errors. 
(Note: No compilation success message may be shown)
f) Type the following to Run the compiled code:
    java Example
(Note: Here Example is replaced by whatever the name of your class was which had the main function)