0
In object oriented programming, everything is considered as part of an object and hence everything is declared inside a class. Let us consider example of chair (I'm using pseudo code here), class chair { int legs = 4 bool wheels = false str material = "wood" str seat = "foam" dbl height = 1.20 } chair myChair = new chair() myChair.material = "metal" We created a generic class chair and then created an object myChair. myChair is a metal chair. Now we can use this chair object in our code. It can have methods like sit(), getUp(), standOnIt(), etc. Please tell me if you don't understand any of the part.
3rd Feb 2019, 3:42 AM
Rugved Modak
Rugved Modak - avatar