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 4 fuera de 32 páginas
Examen

IS 128 Object Oriented Programming I (HU) Midterms Exam Review 2025 (Qns & Ans).

Document preview thumbnail
Vista previa 4 fuera de 32 páginas

IS 128 Object Oriented Programming I (HU) Midterms Exam Review 2025 (Qns & Ans).IS 128 Object Oriented Programming I (HU) Midterms Exam Review 2025 (Qns & Ans).IS 128 Object Oriented Programming I (HU) Midterms Exam Review 2025 (Qns & Ans).

Vista previa del contenido

IS 128

Object-Oriented Programming I

Midterms Exam Review (Qns & Ans)

2025



1. Which of the following is a key benefit of encapsulation in
object-oriented programming?
A. Allows direct access to class fields
B. Hides implementation details and protects object state
C. Improves data storage efficiency
D. Enables the creation of abstract classes
- ANS: B. Hides implementation details and protects object
state
- Rationale: Encapsulation restricts direct access to object
fields, ensuring controlled interaction through methods.

©2025

,2. What is the primary purpose of polymorphism in OOP?
A. To reduce memory consumption
B. To allow a single interface to represent different data types or
classes
C. To simplify debugging processes
D. To store objects in arrays
- ANS: B. To allow a single interface to represent different
data types or classes
- Rationale: Polymorphism enables code flexibility by
allowing a single method or interface to work with different types
of objects.


3. In object-oriented programming, what is the term for creating
a new class based on an existing class?
A. Encapsulation
B. Composition
C. Inheritance
D. Abstraction
- ANS: C. Inheritance
- Rationale: Inheritance allows a new class (child) to acquire
properties and behaviors of an existing class (parent).

©2025

,4. Which of the following defines an abstract class?
A. A class with only static methods
B. A class that cannot be instantiated and includes at least one
abstract method
C. A class with private fields only
D. A class that implements an interface
- ANS: B. A class that cannot be instantiated and includes at
least one abstract method
- Rationale: Abstract classes serve as blueprints for other
classes and cannot be instantiated directly.


5. What does the "this" keyword refer to in object-oriented
programming?
A. The parent class
B. The current instance of the class
C. A static class variable
D. An unrelated object
- ANS: B. The current instance of the class
- Rationale: The "this" keyword is used to refer to the current
object within a method or constructor.


©2025

, ---


Fill-in-the-Blank Questions
6. __________ is the principle that allows a derived class to
override a method in its base class with a new implementation.
- ANS: Method Overriding
- Rationale: Method overriding occurs when a subclass
provides its own implementation for a method defined in its
parent class.


7. In OOP, __________ is a design pattern that ensures a class
has only one instance and provides a global access point to it.
- ANS: Singleton
- Rationale: The Singleton pattern restricts a class to a single
instance, often used in resource management.


8. The __________ relationship in object-oriented programming
is characterized by "is-a" hierarchy, such as a car being a type of
vehicle.
- ANS: Inheritance
- Rationale: The "is-a" relationship defines inheritance,
where a subclass inherits properties and behaviors from a
superclass.


©2025

Información del documento

Subido en
13 de marzo de 2025
Número de páginas
32
Escrito en
2024/2025
Tipo
Examen
Contiene
Desconocido
$16.99

¿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.
Examiner651
5.0
(2)
Vendido
21
Seguidores
5
Artículos
3734
Última venta
1 mes 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