Welcome to Java tutorial series. In this lesson, you will learn about following topics:
Compiling Java Program
For compiling Java program, first your code must write the code using text editor and save with .java extension. The file name must be the same as the class name.
After this you can compile your program using javac compiler, which translate java source code into java byte code. The output from a Java compiler comes in the form of Java class files with .class extension.
Pursue the following steps to convert a Java source program into an object program:
This will produce one or more .class files, which are Java byte code.
Interpreting and running Java Program
Interpreting and running a Java program is process of executing the Java Program. In this process the Java VM is invoked and it takes the byte code and interprets it. In this process the byte code is converted to platform-dependent machine codes so that your computer can understand and run the program.
Once your program successfully compiles into Java bytecodes, you can interpret and run your applications on any Java VM or JVM enabled web browser as applet.
For running java code at the command line on Unix and DOS shell operating systems, you need to issue: java Greeting.
This command will interprets byte code hold by .class file and converts into machine specific binary code. Then JVM runs the binary code on the host machine.
Liked it! Share this Tutorial