View this PageEdit this PageAttachments to this PageHistory of this PageHomeRecent ChangesSearch the SwikiHelp Guide
Hotspots: Admin Pages | Turn-in Site |
Current Links: Cases Final Project Summer 2007

Discussion 4 by Michael Gorbsky

Discussion 4: Answer a Midterm Review Question.

Definitions

Define each and give an example.

a. What is Inheritance?

It is the use of classes that aquire the attributes and functions of the class from which it extends. Class Animal has the function called breath, which is something all animals are required to do. Class Dog extends Animal, thus the function breath can be called from within Dog since it is defined in Animal.

b. What is Delegation?

It is when a class, instead of performing a job, passes it on (or "delegates" it) to another class. Two classes Concious and Subconcious exist. The concious mind does not need to handle mundane tasks like breathing. So it passes the job of breathing to Subconcious.

c. What is Polymorphism?

It means having many different classes that implement the same superclass. For instance, Bird, Fish, and Dog are all Animals. Although they are very different types of Animals, all of them still extend Animal.

Links to this Page