answers correctly solved 2025
is-a relationship - correct answer ✔One object is type of another.
has-a relationship - correct answer ✔One object has reference to another.
superclass, parent class, base class - correct answer ✔The original class
that is used to derive a new class using inheritance.
child class, subclass - correct answer ✔A class that is derived from another
class.
super - correct answer ✔Used to refer to the parent class in a child class.
Often used to invoke the parent's constructor (not inherited).
access control modifiers - correct answer ✔Keywords that are added to
definitions to control access to them.
default/no modifier - correct answer ✔access control modifier - visible to the
package
private modifier - correct answer ✔access control modifier - visible to the
class only
public modifier - correct answer ✔access control modifier - visible to the
world
,protected modifier - correct answer ✔access control modifier - visible to the
package and all subclasses - shown with a # symbol preceding them in UML
diagrams
static variable - correct answer ✔A variable that exists independently of any
instances created for the class. Only one copy of the variable exists
regardless of the number of instances of the class.
static method - correct answer ✔A method that exists independently of any
instances created for the class.
final variable - correct answer ✔A variable that cannot be modified once
initialized.
final method - correct answer ✔A method that cannot be overridden by any
subclasses.
final class - correct answer ✔A class that cannot be inherited.
abstract class - correct answer ✔A class that can never be instantiated. Its
sole purpose is to be extended. Does not need to contain abstract methods.
The child of an abstract class must override the abstract methods of the
parent, or it too will be considered abstract.
abstract method - correct answer ✔A method declared without any
implementation. The implementation is provided by the subclass.
object class - correct answer ✔All Java classes are subclasses of this class.
Defined in the java.lang package of the Java standard class library.
, String toString() - correct answer ✔This method is defined in the Object class
to return a string representation of the object. We often override this to provide
important information when printing an object.
boolean equals (Object obj) - correct answer ✔This method is defined in the
Object class to return true if this object is an alias of the specified object.
Object clone () - correct answer ✔This method is defined in the Object class
to return a copy of this object.
extends - correct answer ✔Used to establish an inheritance relationship.
mutator method - correct answer ✔Used to modify an existing variable.
accessor method - correct answer ✔Used to access an existing variable
overriding methods - correct answer ✔A child class can override the
definition of an inherited method in favor of its own. The new method must
have the same signature as the parent's method, but can have a different
body. The type of object executing the method determines which version of
the method is invoked.
shadowing variables - correct answer ✔overriding a variable - generally
should avoid doing this
overloading - correct answer ✔Deals with multiple methods with the same
name in the same class, but with different signatures. Lets you define a similar
operation in different ways for different parameters.