Exam Questions and Answers Graded A+
Inheritance is a mechanism in which one class can inherit the ______ of another
"parent" class - Correct answer-fields and methods
In Java, a class can ______ up to one other class to inherit from it - Correct
answer-extend
Can a class extend multiple classes? - Correct answer-no a class can only extend 1
other class
An ______ does not have a body - Correct answer-abstract method
An abstract method only has a ______ - Correct answer-method signature
______ cannot be instantiated - Correct answer-interfaces and abstract classes
Interfaces can be ______ by classes or abstract classes - Correct answer-
implemented
Interfaces can be ______ by other interfaces - Correct answer-extended
The keyword used to inherit an Interface is... - Correct answer-implements
©COPYRIGHT 2025, ALL RIGHTS RESERVED 1
, The keyword used to inherit a class or abstract class is ________ - Correct answer-
extends
______ is when a subclass redefines a method of it's parent class - Correct answer-
Overriding
______ are not inherited - Correct answer-private and static members
To call the constructor of a parent class, you must use the ______ keyword -
Correct answer-super
The default access modifier is ______ - Correct answer-package-private
A package-private member of a class is visible to ______ - Correct answer-
members of the same package
A public member of a class is visible to ______ - Correct answer-everything
A private member of a class is visible to ______ - Correct answer-only the defining
class
A protected member of a class is visible to ______ - Correct answer-subclasses and
members of the same package
private members and static methods cannot be ______ - Correct answer-overridden
©COPYRIGHT 2025, ALL RIGHTS RESERVED 2