JVM stands for Java Virtual Machine. It is a set of programs developed by Sun micro system and supplied as a part of Java Run Time Environment(JRE).Firstly we write the simple java program(source code) the java compiler converts the source code into the byte code, after that JVM reads this bytecode and converts this into the machine code.
Byte code is an intermediary language between Java source and the host system. Most programming language like C and Pascal converts the source code into machine code for one specific type of machine as the machine language vary from system to system . Mostly compiler produce code for a particular system but Java compiler produce code for a virtual machine. .
{
public static void main(String arg[])
{
System.out.println("This is my first program....");
}
}
Save the file with same name as the public class just adding the extension '.java'
ex: demo.java
Now compile as:
c:\ javac demo.java
This creates a class file in with the same name, This is the bytecode form of Java program.
Now to execute this code:
c:\ java demo
OUTPUT:
This is my first program....
0 comments:
Post a Comment