How to run java Program

Java program execution involve two steps.


In first step java program is compiled and ".class" file is generated which is also known as byte code.

Syntax:

	javac <java_program>
	   

For example if java program is stored in file "one.java" then command is

Example :

	javac one.java
	    


Important ! Javac command generate a new file with .class extenstion. This new file is known as byte code.

In second step byte code is executed by interpreter. Java uses both compiler and interpreter.

Command:

	java <java class file name>
		

For executing "one.java" program.

	java one