Generalization creates a concept with a broader scope. Specialization creates a concept with a narrower scope. Reusing the interface! Inheritance: get the interface from the general class. Objects related by inheritance are all of the same type.
Polymorphism: One piece of code works with all shape objects. Dynamic binding: How polymorphism is implemented Take previous Shape class hierarchy remove inheritance remove general and abstract class Shape
An object is an encapsulation of data. An object has identity (a unique reference) social security number (cpr), employee number, passport number state, also called characteristics (variables) hungry, sad, drunk, running, alive behavior (methods) eat, drink, wave, smile, kiss An object is an instance of an class A class is often called an Abstract Data Type (ADT).
Comments
Post a Comment