Difference between revisions of "Object-oriented programming"

From CS 61A Wiki
Jump to: navigation, search
[checked revision][checked revision]
(definition)
(Terminology: add list)
Line 4: Line 4:
  
 
== Terminology ==
 
== Terminology ==
 +
* object
 +
* class
 +
* instance
 +
* method
 +
* [[attribute]]
  
 
== Syntax ==
 
== Syntax ==

Revision as of 15:30, 6 July 2014

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

Motivation

Terminology

Syntax

to override method for the class: A.method = lambda self: "test" to override method for an instance: inst.method = lambda: "test"

Inheritance

Main article: Inheritance