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.


	javac <java_program>

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

Example :


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.


	java <java class file name>

For executing "" program.

	java one