Tuesday, January 15, 2008

CSE 2011 Lecture 4

Inheritance

  • An object is a collection of data and methods to operate on that data
    • Method is a procedure, function, operation
  • For a motor
    • turnOn
    • turnOff
    • setSpeed
  • An Object is an instance of a Class
    • The class provides the template for the object
  • Template gives
    • Data
    • Methods
  • Class contains methods, objects contain the data
    • Typically pictured as an object pointing to the class
    • Because the object uses methods
    • Objects share methods

Container

  • A collection of data is stored in a container
    • The data can be of different sub-types
  • Containers can be organized in different ways
    • Sequence,
    • Tree's
    • Table

Sequence

  • A list of objects in order
    • Contains a head, front, tail and last
    • Sequence = <head. ^ tail = front ^ <last>

No comments: