What is the difference between an object and a class?

 Classes and objects are separate but related concepts. Every object belongs to a class and every class contains one or more related objects.  Ø      A Class is static. All of the attributes of a class are fixed before, during, and after the execution of a program. The attributes of a class don't change. Ø       The class to which an object belongs is also (usually) static. If a particular object belongs to a certain class at the time that it is created then it almost certainly will still belong to that class right up until the time that it is destroyed. Ø       An Object on the other hand has a limited lifespan. Objects are created and eventually destroyed. Also during that lifetime, the attributes of the object may undergo significant change.

Showing Answers 1 - 60 of 60 Answers

vishnu bobade

  • Sep 8th, 2005
 

Classes and Objects: Classes are explained, focusing on member data and methods, as well as access control. Constructors and destructors are introduced, and the difference between interface and implementation is emphasized.  

  Was this answer useful?  Yes

neeraj

  • Sep 15th, 2005
 

paper

  Was this answer useful?  Yes

v.chandrasekhar

  • Jan 17th, 2006
 

OBJECTS: Objects are the basic building concepts of oops.Objects are the basic runtime entities in an object oriented sysyem...In other words data and function which combine into a single entity is called object.CLASS: A class combine data(called data members)and functions(called member functions)Class is a logical framework that defines the relationship between it's members and act as a templatefor creating it's variable called objects.

  Was this answer useful?  Yes

Class is a userdefined datatype with data members and member functions which can be public or privately accessed depending on access specifiers.

Objects are instances of classes which identifies the class propeties.A particular class can have it's own class which makes it identifying it's object.

  Was this answer useful?  Yes

satyendra n. Das

  • Aug 2nd, 2006
 

Class -Classe(s) defines object

Object -Object can't define classes

Class -Object properties can access by class instance on which that object is residing

Object-Should be belonging to any of the class

Object - Can created and destroyed as your necessity.

Class-One class can define any no of Object

Best of Luck

Satya.........

  Was this answer useful?  Yes

Sathyanarayanan Ramakrishnan

  • May 21st, 2007
 

An object realizes its behaviour and state from its skeleton called class

In other words a realization of a class is an object

Cheers

Sathya

  Was this answer useful?  Yes

nishant

  • Jul 8th, 2007
 

I would like to add few more points:

-A Class is a blueprint of an object or we can say that its a template of an object.
-Objects are memebers of a class.
-A class decribes all the attributes of object.

  Was this answer useful?  Yes

gaurav

  • Jul 28th, 2007
 

Class: class is a group of a object that shares common property or class is a collection of methods and functionality.

Object is real time entity of class or it is a instance of class

  Was this answer useful?  Yes

wafa

  • Jul 30th, 2007
 

class is a group of more than one object and it share common property of object.give anyone any example?

  Was this answer useful?  Yes

gurpreet.ronak

  • Oct 18th, 2007
 

Class is a combination of data member & member function where object is used for calling function

In class we declare
In object we call

  Was this answer useful?  Yes

Abhishek

  • Dec 26th, 2012
 

Both are hardly interrelated.

Object
1. Basic runtime entities in object oriented environment.
2. Objects belong to only one class.
3. Objects are a implementation of class.

Class
1. A way to bind data and associated functions together.
2. Class have many objects.
3. Class is a template for creating objects.

  Was this answer useful?  Yes

jaya jaswani

  • Feb 2nd, 2013
 

A class is a user defined data type which is used to declare objects and define the methods and functions to use the object.

An object is an instance of a class. it can be generated according to our needs whenever we want to use that. but classes once declared cant destroyed.

  Was this answer useful?  Yes

Aavi loyal

  • May 7th, 2014
 

Object:- In oop , object is an identifiable entity which has some characteristic and behavior. Object is also treated as run time or logical entity that has data as well as piece of code to manipulate this object. Object can be define into physical or logical form.

  Was this answer useful?  Yes

Silly Selzin

  • May 30th, 2014
 

class is a logical construct
object has a physical reality

  Was this answer useful?  Yes

Gayathri.G.Nair

  • Mar 15th, 2015
 

classes do not hold any information,while a object does. we can create sub-classes,but cant sub-objects.

  Was this answer useful?  Yes

surbhi jaiswal

  • Mar 30th, 2015
 

In class,memory space is not allocated when it is created.while in object,memory space is allocated when it is created.

  Was this answer useful?  Yes

veerendranath

  • Apr 6th, 2015
 

class is blue print of an object.
in general a class does not occupy any memory but an object will occupy memory
object::
"allocation of memory to an object is nothing but allocation of memory for data members "

  Was this answer useful?  Yes

Eric Nantel

  • Apr 23rd, 2015
 

An object is a class instance.

  Was this answer useful?  Yes

Sourav Gupta

  • Dec 2nd, 2015
 

Class is a logical existence but object is a physical existence.

  Was this answer useful?  Yes

sunil

  • Dec 15th, 2015
 

A class can be object but an Object cant be class

  Was this answer useful?  Yes

Ethn

  • Dec 20th, 2015
 

When you overload an operator, the number of parameters is fixed, but the types have to be different. Function overloading does not have this restriction. Although if the number of parameters does not change when you overload a function, the types of the parameters must change.

  Was this answer useful?  Yes

Jumana iqbal

  • Apr 24th, 2016
 

Class is a user degined data type, the variables of class known as object, which are the central focus of object oriented programming

  Was this answer useful?  Yes

Minh Nguyen

  • Jun 27th, 2016
 

A class is an user-defined data structure and an object is an instance of that class.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions