Posts

Showing posts from 2014

Core Java Tutorial

Image
Java Architecture 1. Compilation and interpretation in Java Java combines both the approaches of compilation and interpretation. First, java compiler compiles the source code into bytecode. At the run time, Java Virtual Machine (JVM) interprets this bytecode and generates machine code which will be directly executed by the machine in which java program runs. So java is both compiled and interpreted language. Figure 1: Java Architecture 2. Java Virtual Machine (JVM) JVM is a component which provides an environment for running Java programs. JVM interprets the bytecode into machine code which will be executed the machine in which the Java program runs. 3. Why Java is Platform Independent? Platform independence is one of the main advantages of Java. In another words, java is portable because the same java program can be executed in multiple platforms without making any changes in the source code. You just need to write the java code for one platform and the same progra