DEV Community

Shrikant Dhayje
Shrikant Dhayje

Posted on • Updated on • Originally published at codewithshriekdj.netlify.app

Let's Understand Classes And Objects ( Instances ) In Programming for Simplicity.

There is An programming called

OOP : Object Oriented Programming.

This Was Very Hard To Understand in my school because the teacher directly horrify us with words like polymorphism, Inheritance and other Words.

At here we will try to Understand What Are they not learn.

While Creating classes and objects in our program we should consider our self something similar to A God, a virtual god and our software(app) as our virtual world.

We Create a Blueprint for our Characters in World Which is Class for example,

class Human {
  int total_hands = 2;
  int total_nose = 1;
  bool is_alive = true;
  ...
}
Enter fullscreen mode Exit fullscreen mode

And The Objects ( A.K.A. Class Instances ) are actual Characters of Our virtual world.

Same goes for other parts of the software program like vehicle, plant, machines, etc.,

There is Also An Scope for our Characters in virtual world.
Like Public The Part Visible to Everyone similar to face;
Private the part which is not visible or accessible to everyone directly similar to organs and last protected which is publicly available or visible under some rules like authority given by the Character to Other Characters.


Conclusion

If you found this useful then please share this and follow me! Also check out Buy Me A Coffee if you want to support me on a new level!

Buy me a coffee

Top comments (1)

Collapse
 
shriekdj profile image
Shrikant Dhayje

write out your thoughts or comments here. 👋