Object-oriented programming

From CS 61A Wiki
Revision as of 15:37, 6 July 2014 by Axis (Talk | contribs)


Jump to: navigation, search

Object-oriented programming (OOP) is a method for bundling together information and related behavior.

Motivation

  • data abstraction/ADT

Terminology

Syntax

  • dot notation
  • bound method vs function
  • self
  • init
  • attribute access/assignment
    • for methods
      • for the class: A.method = lambda self: "test"
      • for an instance: inst.method = lambda: "test"

Inheritance

Main article: Inheritance

Sources