Please enable JavaScript.
Coggle requires JavaScript to display documents.
Programming Techniques 2.2.1 - Coggle Diagram
Programming Techniques
2.2.1
OOP
Basic Concepts
Objects
Class definition instantiates (creates) an object.
class pet:
= the class, its definition & instance statement will follow
Tim = pet(attributes)
= instantiation of object using class
Super/ parent classes have their attributes & methods used as a foundation to be added to or be edited to create a sub/ child class through polymorphism.
Generally, to find the objects in a problem, look for nouns that stand out and appear important to the problem.
Attributes
The characteristics of an object
Kept as private
Therefore user must use a setter method to alter attributes
Methods
What "actions" the object can make
ie verbs
Getter Methods
Returns the value of an attribute to user
Setter Methods
Alters the value of an attribute
Public to user