• ¿Documento equivocado? Cámbialo gratis
  • Escrito por estudiantes que aprobaron
  • Inmediatamente disponible después del pago
  • Leer en línea o como PDF
Vender
¿Dónde estudias?
Tu idioma
Document preview thumbnail
Vista previa 3 fuera de 30 páginas
Examen

SD 2 – Object-Oriented Programming 7

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

SD 2 – Object-Oriented Programming 7

Vista previa del contenido

1. What does the term "polymorphism" in object-oriented programming refer to?

A. Objects take multiple forms

B. The ability to hide data

C. The reuse of code

D. The process of creating a new class from an existing class

Answer: A) Objects take multiple forms

Rationale: Polymorphism allows objects to take on different forms, typically

through method overloading or method overriding.




2. What does the this keyword refer to in object-oriented programming?

A. A reference to the current class

B. A reference to the current object

C. A reference to the parent class

D. A reference to the method in the class

Answer: B) A reference to the current object

Rationale: The this keyword refers to the current instance of the class.

,3. Which of the following is the correct definition of abstraction in OOP?

A. Hiding data and methods from external access

B. Defining the interface and leaving the implementation to the derived class

C. Reusing code from multiple classes

D. Overloading methods in the same class

Answer: B) Defining the interface and leaving the implementation to the derived

class

Rationale: Abstraction hides the complex implementation details and exposes only

the necessary parts of an object or class through a simplified interface.




4. Which of the following is an advantage of object-oriented programming?

A. It is faster to write than procedural programming

B. It focuses on the behavior of data

C. It uses fewer resources

D. It organizes code into objects that can be easily reused

Answer: D) It organizes code into objects that can be easily reused

, Rationale: OOP promotes code reuse, modularity, and easier maintenance by

organizing code into reusable objects.




5. What is the purpose of a destructor in object-oriented programming?

A. To initialize the state of an object

B. To destroy an object and free memory

C. To return a value from an object

D. To define methods for an object

Answer: B) To destroy an object and free memory

Rationale: A destructor is a special method used to clean up or release resources

when an object is destroyed.




6. Which of the following is a key feature of encapsulation?

A. Hiding the implementation details

B. Reusing code from parent classes

C. Sharing data between different classes

D. Allowing multiple objects to inherit the same properties

Answer: A) Hiding the implementation details

Información del documento

Subido en
17 de marzo de 2025
Número de páginas
30
Escrito en
2024/2025
Tipo
Examen
Contiene
Preguntas y respuestas
$10.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
douglasmugwe82
5.0
(1)
Vendido
2
Seguidores
0
Artículos
4215
Última venta
1 año 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