Previous-year question practice database
Answer
Exam answer
Java bytecode is the intermediate, machine-independent code produced by the Java compiler (javac) when a .java source file is compiled. It is stored in a .class file and is not executed by the processor directly — the Java Virtual Machine (JVM) interprets it at run time.
Explanation
The point to bring out is WHY bytecode exists. Because every platform has its own JVM but the bytecode is the same everywhere, one compiled program runs on any machine — this is what makes Java platform independent, and it is the phrase examiners look for. Contrast C++, which compiles straight to machine code for one particular processor. Mention the chain: .java source, javac, .class bytecode, JVM, execution.
More from Revision Tour I
The full form of JVM is:2026Which of the following occupies 2 bytes of storage?2026In a statement c = c + (x * d + e); which variable is an accumulator?2026Assertion (A): The result of the Java expression 3 + 7/2 is 6.
Reason (R): According to the hierarchy of operators in Java, addition is done first followed by division.2026Evaluate the Java expression:
x = a * b % (++c) + (++a) + (--b);
if a = 7, b = 8, c = 22026System.out.println('Z' + 32); will display:2025