Escrito por estudiantes que aprobaron Inmediatamente disponible después del pago Leer en línea o como PDF ¿Documento equivocado? Cámbialo gratis 4,6 TrustPilot
logo-home
Document preview thumbnail
Vista previa 3 fuera de 17 páginas
Examen

COMP 1231 Final Question and answers correctly solved 2025

Document preview thumbnail
Vista previa 3 fuera de 17 páginas

COMP 1231 Final Question and 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

Vista previa del contenido

COMP 1231 Final Question and
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.

Información del documento

Subido en
13 de agosto de 2025
Número de páginas
17
Escrito en
2025/2026
Tipo
Examen
Contiene
Preguntas y respuestas
$17.49

¿Documento equivocado? Cámbialo gratis Dentro de los 14 días posteriores a la compra y antes de descargarlo, puedes elegir otro documento. Puedes gastar el importe de nuevo.
Escrito por estudiantes que aprobaron
Inmediatamente disponible después del pago
Leer en línea o como PDF

Seller avatar
Los indicadores de reputación están sujetos a la cantidad de artículos vendidos por una tarifa y las reseñas que ha recibido por esos documentos. Hay tres niveles: Bronce, Plata y Oro. Cuanto mayor reputación, más podrás confiar en la calidad del trabajo del vendedor.
LEWISSHAWN55
2.9
(11)
Vendido
96
Seguidores
46
Artículos
7346
Última venta
6 días hace



Por qué los estudiantes eligen Stuvia

Creado por compañeros estudiantes, verificado por reseñas

Calidad en la que puedes confiar: escrito por estudiantes que aprobaron y evaluado por otros que han usado estos resúmenes.

¿No estás satisfecho? Elige otro documento

¡No te preocupes! Puedes elegir directamente otro documento que se ajuste mejor a lo que buscas.

Paga como quieras, empieza a estudiar al instante

Sin suscripción, sin compromisos. Paga como estés acostumbrado con tarjeta de crédito y descarga tu documento PDF inmediatamente.

Student with book image

“Comprado, descargado y aprobado. Así de fácil puede ser.”

Alisha Student

Preguntas frecuentes