Difference between revisions of "Object-oriented programming"

From CS 61A Wiki
Jump to: navigation, search
[checked revision][checked revision]
(Terminology: Updated links)
m ({{Sufficient-class}})
 
(3 intermediate revisions by one user not shown)
Line 1: Line 1:
 +
{{Sufficient-class}}
 
{{OOP sidebar}}
 
{{OOP sidebar}}
'''Object-oriented programming''' (OOP) is a method of programming using [[Object|objects]] that store/organize their own data and interact with each other via their methods. Programming languages that support object-oriented programming provide a built-in way to implement [[Data abstraction|data abstractions]], as classes correspond to abstract data types (ADTs).
+
'''Object-oriented programming''' (OOP) is a method of programming using [[object]]s that store/organize their own data and interact with each other via their methods. Programming languages that support OOP provide a built-in way to implement [[Data abstraction|data abstractions]], as classes correspond to abstract data types (ADTs).
 
+
== Motivation ==
+
* [[Data abstraction|data abstraction/ADT]]
+
 
+
== Terminology ==
+
* [[Object]]
+
* [[Class]]
+
* Instance - a single occurrence of a class as an object
+
* [[Attribute#Method|Method]]
+
* [[Attribute]]
+
 
+
== Syntax ==
+
* dot notation
+
* bound method vs function
+
* self
+
* [[init|__init__]]
+
* attribute access/assignment
+
** for methods
+
*** for the class: A.method = lambda self: "test"
+
*** for an instance: inst.method = lambda: "test"
+
 
+
== Inheritance ==
+
{{Main|Inheritance}}
+
  
 
== Sources ==
 
== Sources ==

Latest revision as of 15:01, 24 July 2014

Object-oriented programming (OOP) is a method of programming using objects that store/organize their own data and interact with each other via their methods. Programming languages that support OOP provide a built-in way to implement data abstractions, as classes correspond to abstract data types (ADTs).

Sources