🎓 Get Full Quality Study Materials & Lab ManualsFollow our blog using the button below!  |  📺 Subscribe our YouTube Channel "Lectures by Ravula Govardhan" for Programming Contents!  | 
NEW Experiment #3 — Book Rating & Review System (Node.js + Express) is now live. Read it here →

Class and Object in OOP – Introduction, Difference & Properties

 Introduction to class and object:

  • In the programming world we have so many data items to be represented and to be manipulated. All these data items cannot be flexible represent with the help of primitive data types.
  • In the c language with the help of structure we can create user defined data types.
  • In object oriented implementation by using class we can creates user defined data type.
  • A structure in c cannot organize code and data into the one place.
  • Therefore we say that it does not support encapsulation.

  • So, finally class is the basis for encapsulation. But class is only a data type. By creating a datatype we cannot store data. In business application development data processing in a secured manner is a major concerned.
  • In order to process data we have to store it. Therefore we have to create a variable of type class. This variable is nothing but a object.
  • An object is encapsulated unit.
  • A class is a basis fo encapsulation where as the object implements the encapsulation.
  • Class means collection of variables and methods.

Every object is associated with three things.......

1. Properties

2. Behavior

3. Identity

Properties: -

Variables of an object are nothing but properties. Properties and current values together is known as state of the object.

Behavior: -

The functional part of the object means methods is known as the behavior of objects.

Identity: -

The name of the object which is uniquely identified is known as identity of the object. 

Figure: Diagram showing Java class as blueprint and object as instance with properties, behavior, and identity

<Introduction - Previous                                            Next - Introduction to loops>

0 Ravula Kartheek:

Post a Comment