ISDS 505 Final Ch 10 (with 100% Error-free Answers)
Specific types of objects assume features of more general classes through ____________________. a. polymorphism b. inheritance c. encapsulation d. structure correct answers b. inheritance Which of the following is not a benefit of using inheritance when creating a new class? a. You save computer memory because when you create objects of the new class, storage is not required for parent class fields b. You reduce the chance of errors, because the parent class methods have already been used and tested. c. You make it easier for anyone who has used the parent class to understand the new class because the programmer can concentrate on the new features. d. You save time, because you need not create fields and methods that already exist in a parent class. correct answers a. You save computer memory because when you create objects of the new class, storage is not required for parent class fields A child class is also called a(n) ____________________ . a. extended class b. base class c. superclass d. delineated class correct answers a. extended class Assuming that the following classes are well named, which of the following is a parent class of House? a. Apartment b. VictorianHouse c. Building d. myHouse correct answers c. Building A derived class usually contains ____________________ than its parent. a. more fields and methods b. the same number of fields but fewer methods c. fewer fields but more methods d. fewer fields and methods correct answers a. more fields and methods When you create a class that is an extension or child of another class, you use a(n) ____________________ between the derived class name and its base class name. a. ampersand b. hyphen c. dot d. colon correct answers d. colon A base class named Garden contains a private field width and a property public int Width that contains get and set accessors. A child class named VegetableGarden does not contain a Width property. When you write a class in which you declare an object as follows, what statement can you use to access the VegetableGarden's width? a. VegetableGarden myGarden = new VegetableGarden(); b. myGarden.Width c. myG.Width d. VegetableGarden.Width e. You cannot use Width with a VegetableGarden object. correct answers b. myGarden.Width
Información del documento
- Subido en
- 5 de abril de 2024
- Número de páginas
- 3
- Escrito en
- 2023/2024
- Tipo
- Examen
- Contiene
- Preguntas y respuestas