Previous-year question practice database
Answer
Exam answer
Keywords are reserved words that carry a predefined meaning in the Java language and cannot be used as identifiers — that is, as names for variables, classes or methods.
Examples: class, void, int, static, public, if, for, new.
Explanation
The definition needs two parts: they have a fixed meaning, AND they cannot be reused as names. The second half is what examiners look for, and it explains why int int = 5; will not compile. Give at least one example — the marks are usually split between definition and example. Note that all Java keywords are lower case.
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