0
1.8kviews
Define object and class. State how they are different and give suitable example of each.

Subject: Object Oriented Modeling and Design

Difficulty: Medium

Marks: 4 Marks

1 Answer
0
60views

Definition of object:- An object is a concept, abstraction or thing that has meaning for an application. Object is basic run time entity.

Definition of class:- A Class is a group of objects with similar properties (attributes), common behavior (operation), common relationship to other objects and common semantics.

Difference:-

  • Class specifies properties, behavior, relationships and semantics that all the objects of that class share where as object stores values for individual.
  • Class is a group of objects whereas object is an individual entity with unique identity.

Example of class:- STUDENT is a class. It specifies members as rollno.

enter image description here

Example of object:- For class student: S1, S2, S3,….,Sn are objects.

enter image description here

Please log in to add an answer.