Advanced Java
LATEST FINAL ASSESSMENT
REVIEW
Q&S
©2024/2025
,1. Multiple Choice: What is the purpose of the transient keyword
in Java?
a) To indicate that a variable is temporary
b) To denote that a field is not part of the object's serialized
state
c) To declare a variable as static
d) To mark a variable as volatile
Answer: b) To denote that a field is not part of the object's
serialized state
Rationale: The transient keyword in Java is used to indicate that
a field should not be serialized.
2. Fill-in-the-Blank: An _________ class in Java is a class that
cannot be instantiated and is often used to provide a base for
subclasses.
Answer: Abstract
Rationale: An abstract class cannot be instantiated on its own
and is used to declare common characteristics for subclasses.
3. True/False: In Java, the 'final' keyword can be used to prevent
method overriding.
Answer: True
©2024/2025
, Rationale: The 'final' keyword prevents a method from being
overridden in a subclass.
4. Multiple Response: Which of the following are valid Java
identifiers? (Select all that apply)
a) _identifier
b) $identifier
c) 2ndIdentifier
d) identifier!
Answers: a) _identifier, b) $identifier
Rationale: Java identifiers can begin with a letter, the dollar sign
"$", or the underscore "_". They cannot start with a number or
contain special characters like "!".
5. Multiple Choice: Which method signature is correct for the
main method in a Java application?
a) public static void main(String args)
b) public static void main(String[] args)
c) public void static main(String[] args)
d) static public void main(String args[])
Answer: b) public static void main(String[] args)
©2024/2025
, Rationale: The correct signature for the main method in Java
includes 'public' and 'static' modifiers, 'void' as the return type,
and a String array as the parameter.
6. Fill-in-the-Blank: The process by which one class acquires the
properties and functionalities of another class is known as
_________.
Answer: Inheritance
Rationale: Inheritance allows a class to inherit properties and
methods from another class.
7. True/False: The hashCode() method in Java returns a unique
identifier for each object.
Answer: False
Rationale: The hashCode() method is intended to provide a
unique identifier but does not guarantee uniqueness.
8. Multiple Response: Which of these are Java built-in
annotations? (Select all that apply)
a) @Override
b) @FunctionalInterface
c) @Deprecated
d) @Immutable
©2024/2025