In this section you will learn about, how does java program work.
Program execution in Java
Java Programming language includes Java compiler, Java Virtual Machine and Java class Libraries. JVM is a software implementation that executes the programs.
Complier converts the java code (high level language) into machine code i.e. Byte code. The JVM interprets this byte-code and runs the programs.
Steps to execute java program:
• First, the user has to create a classname.java file with any text editor.
• Then, compiled it with this command - javac ClassName.java. The compilation produces as a result a file called ClassName.class
• A program can be executed only after it has been compiled. Command for execution - java ClassName.
Byte code is an instruction set of the Java Virtual Machine, it is created when user wants to compile their java source code than that code will be converted into byte code.
We can also say this portable code or p-code because it is responsible for Java portability and it is executed by virtual machine.
In next segment, you will be able to set-up environment variables