Object Oriented Programming is an object-oriented programming. All data and functions within this paradigm wrapped in classes or objects.
The basic concept of object-oriented programming:
- Encapsulation:
Hiding the complexity of an object. Ensure the user an object can not change the state of an object in a way that is not feasible, only the method in which the object is given permission to access the situation.
Example: in making cakes (class) are materials that should be used like sugar. While the manufacture of sugar (the object) is there are several ways and materials that are kept secret by the manufacturer.
- Inheritance:
Inherit all the functions and properties of its parent object.
Example: The nature of the sugar (Object parent) sweet
Traits in sugarcane (Object Derivatives) sweet
If the programming parent's name is written so in writing to no longer need to double him, just the name of the derivative.
- Polymorphism:
Can have different properties and behaviors, although the function of these objects have the same name.
Example: in the real world there is only one name like a cat (class). But the only object that is a state (state) and behavior (behavior) is different.
Class and Object
In object oriented programming class there. Class is a collection of some objects. In every object there is definitely variable and method.
salam kompak seduluran : kentank :)
0 komentar:
Posting Komentar