Introduction to Java - Class 9 ICSE
1. Java Compiler as Byte Code
When a Java program is compiled using the Java compiler (javac), it is not directly converted into machine
code. Instead, it is converted into an intermediate code called Bytecode. Bytecode is a set of instructions that
can be executed by the Java Virtual Machine (JVM). This makes Java programs more portable and secure.
2. Java Interpreter as Virtual Machine (JVM)
The Java Virtual Machine (JVM) is responsible for interpreting or executing the Bytecode generated by the
compiler. The JVM reads the bytecode and converts it into machine-specific code at runtime. This makes
Java a platform-independent language because the same bytecode can run on any system that has a JVM.
3. Java Reserved Words
Reserved words (also called keywords) are predefined words in Java that have special meaning and cannot
be used as identifiers (like variable names or class names).
Examples: class, public, static, void, int, new, if, else, return.
4. Explain: public static void main(String args[])
This is the main method in a Java program where execution begins:
- public: Accessible from anywhere.
- static: Can be run without creating an object.
- void: It does not return any value.
- main: The name of the main method.
- String args[]: Accepts command-line arguments in the form of an array of Strings.
5. Platform Independence using JVM
Java is platform-independent because the Java compiler converts code into Bytecode, which is not tied to
any specific operating system. The Bytecode is then executed by the JVM, which is available for various
platforms like Windows, Mac, or Linux. This allows Java programs to run on any platform with a compatible
Introduction to Java - Class 9 ICSE
JVM installed.