Inheritance
- An object is a collection of data and methods to operate on that data
- Method is a procedure, function, operation
- Method is a procedure, function, operation
- For a motor
- turnOn
- turnOff
- setSpeed
- turnOn
- An Object is an instance of a Class
- The class provides the template for the object
- The class provides the template for the object
- Template gives
- Data
- Methods
- Data
- Class contains methods, objects contain the data
- Typically pictured as an object pointing to the class
- Because the object uses methods
- Objects share methods
- Typically pictured as an object pointing to the class
Container
- A collection of data is stored in a container
- The data can be of different sub-types
- The data can be of different sub-types
- Containers can be organized in different ways
- Sequence,
- Tree's
- Table
- Sequence,
Sequence
- A list of objects in order
- Contains a head, front, tail and last
- Sequence = <head. ^ tail = front ^ <last>
- Contains a head, front, tail and last
No comments:
Post a Comment