Class & Object:
- Class it is like an data type and Object like variables.
- As we can define variable MyString and Type will String
- Also we can define Object MyObject and class will be Class A
- Any Object will represent an instance of Class
- We can define more than one objects belong to same class, as we can define more than one variables with string type.
Properties & Fields
- Properties and fields will give accessibility to the Object Data
- Object data which the things that differ each object from other objects which belong to same class. For example if we want to represent the coffee in OOP we can assume we have Class call it CupOfCoffee we can have different objects belong to that class , if we assume the CupOfCoffee class will have filed call it coffee name so we can have the following objects:
- Object1:Turksh Coffee
- Ojbect2: Nescafe Coffee
- As we can see we can differentiae the two objects based on the value of Name Field
To access the full
version of this article please refer to the following link
:
No comments:
Post a Comment