These are flashcards an notes made by students on topics like 'pet', 'subclass' and 'features', originating from:

- Michael Jesse Chonoles
ISBN-10 0128096403 ISBN-13 9780128096406
1335 Flashcards & Notes
  • This + 400k other summaries, also in PDF!
  • A unique study and practice tool
  • Never study anything twice again
  • Get the grades you hope for
  • 100% sure, 100% understanding
Remember faster, study better. Scientifically proven.
Trustpilot Logo

Study Cards on pet, subclass, features

When you have several classes with similar attributes and similar behaviors, you can look for....?
When you have several classes with similar attributes and similar behaviors, you can look for common features
Report
Consider that a jurisdiction may have licensing procedures for dogs, cats, tigers, snakes, and alligators.

Instead of treating them all separately, you could also...?
Instead of treating them all separately, if you abstract the common features from each class and create a new superclass to house these common features, you could define many of the features only once.

You could create a Pet class—Allowing a loop through all the pets during renewal season without making separate loops for each subclass.
Report
If the details of getting or renewing a license were different for each subclass, you would define an abstract operation on the Pet class called renewLicense().

What would each subclass have then?
Each subclass would have to have the specific implementation for the operation.

However, the users of the Pet class would not have to deal with the details and would not need to know what type of Pet is currently being handled.
Report
  • Higher grades + faster learning
  • Don't study anything twice
  • 100% sure, 100% understanding
Discover Study Smart