14 Aug 2012

Why java is both interpreted and compiler ?

 Q)Why java is both interpreted and compiler ?


 Soln) Programming language classified as:

  • Higher level language ex: c++, java
  • Middle level language ex: c
  • Low level language ex: assembly
  • Lowest level as the machine language

Compiler: 

Compiler is a program which converts a program from one level of language to another. Example: conversion of c++ program into machine code.
The java compiler is a converts high level java code into byte code(which is also a type of machine code).

Interpreter:

Interpreter is a program which converts a program at one level to another programming language at the same level. Example conversion of java program into c++.