Introduction to Java IX
Q1: What are the two types of java programs?
A: The two types of java programs are:
i. Stand-alone Java Applications
ii. Java Applets
Q2: What are java applets?
A: Java applets are Java applications that run within the web browser. They are mainly used for internet programming.
Q3: Define Source Code and Object Code.
A: Source Code: A set of instructions written in a high-level programming language is called a source code.
Object Code: A compiler generated machine language version of the source code is called object code.
Q4: Define Compiler, Assembler and Interpreter.
A: Compiler: A compiler is a program that translates code written in a high level language into machine code.
Assembler: An assembler is a program that translates an assembly language program into machine code.
Interpreter: An interpreter translates the source code instructions into machine code line by line.
Q5: What is a Bytecode ?
A: The programs written in Java are compiled into an intermediate language for a virtual computer called Java Virtual
Machine (JVM). This intermediate language for Java Virtual Machine is called Java Bytecode. The Bytecode files are
generated with the “.class” extension.
Q6: What is a JVM?
A: JVM stands for Java Virtual Machine. It is a virtual machine that runs Java programs and can be installed on several
different operating systems such as UNIX, Macintosh etc. JVMs allow Java programs to run on almost any computer.
Q7: Name two features of Java.
A: The two features of Java are:
i. It is object-oriented
ii. It is platform independent.
Q8: Briefly describe the java compilation process.
A: Java source code (.java) is converted to an intermediate code (.class) by the java compiler. This intermediate code is
called the Bytecode. This Bytecode is then converted to machine code by java interpreter Java Virtual Machine (JVM).
Java Compilation Process