What Is Class And Object In OOP?

What Is Class And Object In OOP?
Share

1 Answer

  1. Class in Object Oriented Programming (OOP) is like a blueprint for an object. We define the basic structure of an object in the class. The behavior of object is also defined in a class.

    Object is created using the class. We pass values using the object which then behave in the way that the class is designed.

    For example a class with the name animal may have methods like hands(), legs(), tail() defined.
    An object with the name dog can be created and referenced to class animal. Now the object dog can use the methods of class animal as its behavior.

    • 0