Welcome to Java tutorial series. In this lesson, you will learn about following topics:
For this tutorial you can use any text editor for writing the Java program and then use the command prompt to run the example code.
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.
This video tutorial explains you the the process of compilation and interpretation of Java program.
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.
What next? Check all the Core Java programming video tutorials.
Rs. 20,000 US$ 300
Today: Rs. 10,000 US$150
Course Duration: 30 hrs
Posted on: June 11, 2013 If you enjoyed this post then why not add us on Google+? Add us to your Circles