Apr 7, 2012

Java Interpreter

Java's interpreter is called java. It converts the bytecode output from the javac compiler to machine code and executes it.

Java is unlike purely interpreted languages, which generally interpret source code before execution, sacrificing performance. Another important feature of Java that Sun boasts is high performance. Execution by Java's interpreter is near to the speed of binary executables produced by compiled languages. The reason for this is that Java code is compiled to an intermediate stage where the file is still architecture-neutral, but close enough to machine code that it can run efficiently. In addition, Java's multithreading feature can improve performance by moving interpreter operation to the background.

In addition to architecture-independence, the other advantage of using the Java interpreter is security. The interpreter can evaluate classes to ensure that the bytecodes being interpreted do not violate any language constraints or perform illegal activities on the system or memory. This can prevent many viruses from spreading.

The interpreter runs outside the browsing environment. It provides the programmer with the ability to run stand-alone applications that have nothing to do with the Internet but that are portable and platform-independent. 


Post a Comment