ISDS 505 Final Ch 10 Question ans answers 100% solved.
Specific types of objects assume features of more general classes through ____________________. a. polymorphism b. inheritance c. encapsulation d. structure - Answer- 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. - Answer- 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 - Answer- 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 - Answer- 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 - Answer- 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 - Answer- 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. - Answer- b. myGarden.Width When a parent class contains a private data field, the field is ____________________ the child class. a. hidden in b. not a member of c. directly accessible in d. public in - Answer- a. hidden in When a base class and a derived class contain a method with the same name and parameter list, and you call the method using a derived class object, ____________________. a. you receive an error message b. the base class version overrides the derived class version c. the derived class version overrides the base class version d. both method versions execute - Answer- c. the derived class version overrides the base
Geschreven voor
- Instelling
- ISDS 505
- Vak
- ISDS 505
Documentinformatie
- Geüpload op
- 18 maart 2024
- Aantal pagina's
- 6
- Geschreven in
- 2023/2024
- Type
- Tentamen (uitwerkingen)
- Bevat
- Vragen en antwoorden
Onderwerpen
-
isds 505 final ch 10 question ans answers 100 sol