Computer Science 201: Data Structures & Algorithms Ch. 2 Questions with Verified Solutions
Computer Science 201: Data Structures & Algorithms Ch. 2 Questions with Verified Solutions **Object-Oriented Design Concepts** - **What concept of Object-Oriented Design is illustrated when the Novel class inherits all methods and fields from the Book class?** Inheritance **Encapsulation Example** - **What term describes keeping the details of a method and its variables invisible to other classes while allowing access to the method itself?** Encapsulation **Polymorphism Illustration** - **In Object-Oriented Design, when different subclasses like RootBeer and Beer use the same method brew() in different ways inherited from a parent class SoftDrink, what principle does this demonstrate?** Polymorphism **Understanding Instance and Class Relationships** - **When creating a new object of the Semi class in a program for vehicles, what is the correct term to describe this relationship?** Instance; Semi class **Hierarchy of Classes and Functionality** - **After designing a hierarchy of classes for accounting software, what additional component is necessary for these classes to perform tasks?** Methods **Difference Between Functions and Methods** - **How do functions differ from methods in Object-Oriented Programming?** Methods are procedures associated with a class that describe actions objects can perform. **Objects Under a Class** - **In an Object-Oriented Program for vehicles, what are car, truck, and bus referred to collectively when under the class named Vehicle?** Objects **Core Concepts of Object-Oriented Programming** - **Which of the following is NOT considered a fundamental concept of Object-Oriented Programming?** Inference **Creating a Blueprint for Objects** - **When designing Object-Oriented Program code for vehicles that includes attributes like manufacturer, color, and price, along with methods like start, drive, and park, what is needed to define this structure?** Class **Parent Class Terminology** - **What term is used interchangeably with "parent class" in Object-Oriented Programming?** Superclass **Reusing Methods in Subclasses** - **When a subclass modifies and reuses a method from its parent class, what is this specific behavior called?** Overriding
Información del documento
- Subido en
- 30 de junio de 2024
- Número de páginas
- 12
- Escrito en
- 2023/2024
- Tipo
- Examen
- Contiene
- Preguntas y respuestas