Process to compile and execute the java program…?

Process to compile and execute the java program

A process to compile and execute the java program:-

In JAVA there is some step to process and execute the java program.

A compilation is a process in which convert the program from a high-level language to machine level language.Java compilers include the Java Programming Language Compiler (javac). The content of each class contained in the source file is stored in a separate ‘.class’ file.

An object file can be directly loaded into computer memory and execute. The process of loading the object file and running the file is known as execution.

Step-1

Develope a java program      (Test.java)

//Test.java
class Test
{
public static void main(String args[])
{
System.out.println(“Hello World”);
}
}

 

Step-2

Compile the java program.

  1. a javac is a development tool of JDK which is responsible to compile java program in any environment.

javac filename.java
————————-
javac Test.java

 2. javac compiler generate .class file after successfully compile the .java file.

3. The .class file is the collection of bytecode.

4. Bytecode is known as the magic code in JAVA and this code can be executed by JVM(JAVA VIRTUAL MACHINE).

Step-3

1. Execute the JAVA program.

2.JAVA is a JDK tool which is responsible to execute the class file with the help of JVM.

java class name
———————–
java Test

 

OUTPUT:“Hello World

basicittopic

basicittopic

A Computer Science Study for IT students and people of IT community

2 thoughts on “Process to compile and execute the java program…?

Leave a Reply