Welcome to graduate2professional.blogspot.com

Wednesday, November 11, 2009

What is the difference between an object and a class?

Class and Objects are diff but related concepts. Every object belongs to the class and every class has a one or more related objects.

Class is:
1. A Class is static.
2. A class combination of data (called data members) and functions (called member functions).
3. Class is a user defined data type with data members and member functions.
4. Class defines object.
5. One class can define any no of Object.
6. Class is a template (type) or blue print its state how objects should be and behave.

Object is:
1. Object is an instance of a class while a class can have many objects.
2. Object is a dynamic.
3. Objects are the basic runtime entities in an object oriented system.
4. Data and function which combine into a single entity is called object.
5. Objects are instances of classes which identifies the class properties.
6. Object can't define classes.
7. Object can be created and destroyed as your necessity.
8. Object is defined as a s/w construct which binds data and logic or methods (functions) both.

No comments:

Post a Comment