Question:
What is the difference between an object and a class?
Answer:
Classes and objects are separate but related concepts. Every object belongs to a class and every<br>class contains one or more related objects.<br><br>Ø A Class is static. All of the attributes of a class are fixed before, during, and after the execution of<br>a program. The attributes of a class don't change.<br><br>Ø The class to which an object belongs is also (usually) static. If a particular object belongs to a<br>certain class at the time that it is created then it almost certainly will still belong to that class right<br>up until the time that it is destroyed.<br><br>Ø An Object on the other hand has a limited lifespan. Objects are created and eventually destroyed.<br>Also during that lifetime, the attributes of the object may undergo significant change. Source: CoolInterview.com
class and object for same related methods<br>class is nothing but same related to variable to methods.<br><br>eg car is a class<br><br>maruti santro bolero this is on object <br><br><br><br> Source: CoolInterview.com
Answered by: mg vijaymahindran | Date:
| Contact mg vijaymahindran
A Class is a template. An object is an instance of class. Every data member of an object contains its own value, where as Class only declares the data members. Source: CoolInterview.com
Answered by: Ugandhar | Date: 10/18/2007
| Contact Ugandhar
Class is only a blueprint which has data members and methods whereas objects are the instances of the class which is a clone of the class Source: CoolInterview.com
Answered by: supreeth | Date: 4/14/2009
| Contact supreeth
Class:- class is a group of dissimilar data.<br>It use to create a user defined data type. If we want to store any persons name, address, flat no., sallary etc in a single data type then we create a class.<br><br>Object:- It is the instanse of the class. It contains all properties of the class.<br><br>Both are similar both contain dissimilar data, but we can make an object of the class not class of the object. Class is a properties and Object is the copy of the class properties.<br><br>ex:- BAG is the class and name of the bag are object. Here BAG may contain some things but not any things contains a BAG. Source: CoolInterview.com
Answered by: ALOK RANJAN KUMAR | Date: 5/14/2009
| Contact ALOK RANJAN KUMAR
class is a group of objects that share common properties and responsibility.<br><br><br><br>object is a identifiable entity with some characteristics and behaviour. Source: CoolInterview.com
Answered by: pratima | Date: 6/4/2009
| Contact pratima
Object: <br>#Is a representation of a real world entity. It can be real world, conceptual or a software entity.<br>#An object has a state,exhibits some well defined behaviour & has a unique identity.<br><br>Class:<br># Is a template to create objects<br># A class is a description of a group of objects with common properties, common behaviour, common relationship to other objects & common semantics. <br> Source: CoolInterview.com
Answered by: Gee-Bee | Date: 6/20/2009
| Contact Gee-Bee
Class is a frame work or a blue print where as object is a reality. Source: CoolInterview.com
Answered by: susil manohara sahoo | Date: 7/9/2009
| Contact susil manohara sahoo
class is an capsule that holds the data and member functions together to operate upon the data.<br> object is an instance of a class e.g musician is a class ,asha nd lata r objects of it. Source: CoolInterview.com
Answered by: anupama | Date: 7/15/2009
| Contact anupama
Class have no existence in computer.When we declare a class no space in the computer memory is allocated for it.But object has his own space allocated in the memory.When we declare a object of a class defined before,system understands how much memory is to be allocated for the object. Source: CoolInterview.com
Answered by: Anirban | Date: 8/15/2009
| Contact Anirban
Class is a collection of data members and methods. Object is an instance of a class. separate Memory is allocated for each and every data member of each object. whereas, for a class, only once instance of it is stored in memory. Source: CoolInterview.com
Answered by: Dhwani | Date: 9/4/2009
| Contact Dhwani
A class is template for creation of like objects<br>An object is instance of class<br>Map real world entities into classes through data members & member functions<br>By writing class & creating objects of that class one can map two major pillars of object model i.e. abstraction & encapsulation<br>All members of class are data/methods are private by default<br> Source: CoolInterview.com
Answered by: patil sheetal | Date: 9/5/2009
| Contact patil sheetal
Classes and objects are separate , class contain the member function and data member.but main diffrent is the class is the blue print of object. Source: CoolInterview.com
Answered by: P GOVIND RAO | Date: 9/5/2009
| Contact P GOVIND RAO
class is only declaration.While object is actual creation of memory space for that declaration.<br> Source: CoolInterview.com
Answered by: zrajesh | Date: 9/13/2009
| Contact zrajesh
Class is just a blueprint/templet.<br>It defines the different attributes of a perticular thing.<br>As mentioned in the above example of class car.<br><br>Object is the instance of a class at the time. Different objects share the functions / data members of a class.<br>Eg: maruti, skoda etc. Source: CoolInterview.com
Answered by: santosh kumar inamdar | Date: 9/24/2009
| Contact santosh kumar inamdar
class is the collection of all the methods and identifiers. where as An objects are the instances of that class<br>ex: Bird is a class and sparrow,pecock,crow are the object of the class Bird Source: CoolInterview.com
Answered by: jaywant topno | Date: 9/27/2009
| Contact jaywant topno
The class and objects are different but related concepts<br>class is a userdefined data type while object is a runtime entity it is a variable of type class.<br><br>class can have many objects,an object is a instance of a class<br><br>class is static that is the attribute defined in it are fixed and cnt be change while an object is dynamic<br><br>classes define objects but object cnt define classes Source: CoolInterview.com
Answered by: kanika khanan | Date: 9/28/2009
| Contact kanika khanan
Class is an Idea in Human Mind...<br>Eg: Mobile, Car, FengshueItem, etc<br><br>Object is the Manifestation of an Idea...<br>Eg: Nokia 2300, Maruti 800, WindChimes, etc Source: CoolInterview.com
Answered by: Priyesh | Date: 10/8/2009
| Contact Priyesh
class and object both are different with out class there is no object.but with out object there is a class. Source: CoolInterview.com
Answered by: chandu | Date: 10/19/2009
| Contact chandu
class has data members(int a,float b)<br>and member functions(eg:void car())<br><br>object is used to set values for the <br>data members <br> Source: CoolInterview.com
Answered by: Vijay Anand.D | Date: 10/21/2009
| Contact Vijay Anand.D
class is one we sit and study from our UKG.<br><br>Objects are which we use to play Source: CoolInterview.com
Answered by: Vignesh | Date: 10/21/2009
| Contact Vignesh
object is a run time entity.and classes cantain the objects.<br>eg.<br>the student room is the class and the student is object Source: CoolInterview.com
Answered by: deepika | Date: 10/22/2009
| Contact deepika
CLASS : Class is a User Defined Data type, it is static. Its data are fixed. And also class can create group of objects. Example : 'Car' is a Class.<br>Object : Object is variable of class. and also an instance of class. In general it is real time entity.<br>For Ex : 'Indica', 'Ferrari', 'Safari' these are all objects of 'Car' class. Source: CoolInterview.com
Answered by: Basavaraj Hunshal | Date: 10/24/2009
| Contact Basavaraj Hunshal
class: a class is group of object. once a class is declare you can define many objects in that class.<br>object: object is a run time entity and the instence of class. Source: CoolInterview.com
Answered by: vithika | Date: 10/26/2009
| Contact vithika
class is a logical think but object is run time entity Source: CoolInterview.com
Answered by: subhash | Date: 11/10/2009
| Contact subhash
An object is a real world entity.<br>A class is a collection of the object's characteristics and behaviour. Source: CoolInterview.com
Answered by: velvizhi | Date: 11/21/2009
| Contact velvizhi
class is a collection of data members and member function. Source: CoolInterview.com
Answered by: Manish | Date: 12/7/2009
| Contact Manish
OBJECT:<br>An object is a runtime entity in an object-oriented system.<br>An object takes up some space in memory and have an assosciated address.<br>->Objects have data and code to manipulate the data.<br><br>CLASS:<br><br>we know that an object has data and code to manipulate the data.<br>this set of data and code of an object can be combined in to an user defined data type with the help of a class.<br><br>-->In short a class is a collection of similar type objects i.e having similar properties and attributes. Source: CoolInterview.com
Answered by: hema | Date: 12/9/2009
| Contact hema
An object is a software entity that combines state and behavior. To a programmer object is a region of storage with associated semantics.To a designer object is an identifiable component in the problem domain.<br><br>A class is a programming construct that defines the common state and behavior of similar objects.<br>So class is a blueprint for objects. Source: CoolInterview.com
Answered by: Monalisha Nayak | Date: 12/17/2009
| Contact Monalisha Nayak
class is a collection of data members and member fuctions,while object is an instance of class,i.e.,it is a variable of type class "the name of class".<br>class is made because it only depicts how an object will look like when created ..while creating class but not an object of that class is not of significant use... Source: CoolInterview.com
Answered by: himanshu jethawa | Date: 1/6/2010
| Contact himanshu jethawa
A class is an idea in human mind or we can say class is a blueprint of object.<br>object is a product what v get when we implement on our idea.<br> Source: CoolInterview.com
Answered by: Shabbir | Date: 1/28/2010
| Contact Shabbir
A class is an OOP construct used to provide soul to abstraction and encapsulation. When we want to perform a task in our large project or software and this is going to be a common task among several targets of that task, this task belongs to a group, called class, that is task sharing common properties abstracted to or encapsulated into a class.<br><br>Objects are merely instances of this group, any user of the group pertaining common properties and tasks can is valid and eligible candidate to become object of this group (class). Source: CoolInterview.com
Answered by: Rajendra | Date: 2/4/2010
| Contact Rajendra
class is a user defined data type and object is an small entuti and i is an instance of class Source: CoolInterview.com
Answered by: hema makkar | Date: 2/7/2010
| Contact hema makkar
The logical defination of any object is called class.It is user defined datatype(same as structure)<br>every real time entity which has state and behaviour is called object .The instances of any class is called object Source: CoolInterview.com
Answered by: surbhi jain | Date: 2/9/2010
| Contact surbhi jain
simple answer.better undrstanding... class is a keyword which is used to create a user defined data type(u.d.d.t).while object is d variable of class.<br> Source: CoolInterview.com
Answered by: namrata sharma | Date: 3/4/2010
| Contact namrata sharma
a class and an objects are reles to each other v can say that a class is a set of objects different object together make a class .they relate to the same class unless they destroyed. Source: CoolInterview.com
Answered by: meenakshi | Date: 3/18/2010
| Contact meenakshi
*class contain data member and data function.<br> *object is a instance of a class.<br><br> Every class contain number of objects. Source: CoolInterview.com
Answered by: ashok | Date: 3/21/2010
| Contact ashok
Class is compile time object and no memory is allocated. Objects are run time existance and memory is allocated , probably even for class variables. Thus class binds methods and variable and object is data. Source: CoolInterview.com
Answered by: Ashwin Mehta | Date: 4/24/2010
| Contact Ashwin Mehta
class is a keyword to create user define dataype,which is not fixed in nature and object is the collection of variables which is fixed in size and nature.... Source: CoolInterview.com
Answered by: shilpi | Date: 5/13/2010
| Contact shilpi
Examples:<br>Class:human object:you or me<br> Source: CoolInterview.com
Answered by: pradeep | Date: 5/19/2010
| Contact pradeep
class is user define data types.that contain member data and member function and that data member and member function may be private, public or protected.<br><br>object is a class type variable and one class hava one or more object. object pass message one place to another places. <br> thanks Source: CoolInterview.com
Answered by: alok singh | Date: 5/25/2010
| Contact alok singh
Class: A class is a way to bind the data members and methods. Object: An object is a self-sufficient sud-data with specific functions. Source: CoolInterview.com
Answered by: Aishwarya | Date: 7/7/2010
| Contact Aishwarya
class is a collection of one or more objects .objects are the variable of that class by which we can access the property of that class. Source: CoolInterview.com
Answered by: gunjan sharma | Date: 7/7/2010
| Contact gunjan sharma
objects having code,data. the entire type of code and data can be made user-defined by using the concept of class. Source: CoolInterview.com
Answered by: sivakumar.k | Date: 7/16/2010
| Contact sivakumar.k
Class is basically a Model while object is the pratical representation of that Model(class) Source: CoolInterview.com
Answered by: Muhammad Saqib | Date: 7/16/2010
| Contact Muhammad Saqib
A class is a collection of OOPs (data members and member functions) , Objects are merely instances of this group, any user of the group pertaining common properties and tasks can is valid and eligible candidate to become object of this group (class). it is a variable of type class "the name of class". class is made because it only depicts how an object will look like when created ..While creating class but not an object of that class is not of significant use. Source: CoolInterview.com
Answered by: Basanta P | Date: 7/20/2010
| Contact Basanta P
a class is a thus collection of similar type. classes are user defined and behave like as built in types of programming language. An Object is a basic run time entity in an object oriented system Source: CoolInterview.com
Answered by: SURESH DEVABATTULA | Date: 7/22/2010
| Contact SURESH DEVABATTULA
A class is a group of abjects. its been used in C++ language as it is a OOP's based language. So it deals with the objects and classes helps to hold together all those objects , similarly as the structures do to hold different datatypes together Source: CoolInterview.com
Answered by: akash | Date: 7/23/2010
| Contact akash
Class is declared to define the model (structure) of the object while object is the instance of class used to access the properties and methods Source: CoolInterview.com
Answered by: Muhammad Saqib | Date: 7/30/2010
| Contact Muhammad Saqib
class is a like data type where objects are variables of respective classes. Source: CoolInterview.com
Answered by: shashi | Date: 8/4/2010
| Contact shashi
class is a collection of one or more objects.A single object can refer to different classes. Source: CoolInterview.com
Answered by: shailendra | Date: 8/6/2010
| Contact shailendra
Class is the collection of attributes and methods where as the Object is the real time entity.
Regards, Nicku Source: CoolInterview.com
Answered by: nicku | Date: 8/9/2010
| Contact nicku
object is the real time entity where as the class is the collection of data members and member functions
Regards, Nicku Source: CoolInterview.com
Answered by: nicku | Date: 8/16/2010
| Contact nicku
class is new feauture in oop language in this entire set of data and code f an object can made a user defined data type with the help of class. and object is runtime entity Source: CoolInterview.com
Answered by: akshay bhardwaj | Date: 8/24/2010
| Contact akshay bhardwaj
A class is an organisation of data and function which operate on them. Data structure are called the data member and function are called the member function. Source: CoolInterview.com
Answered by: vikas | Date: 9/7/2010
| Contact vikas
object is run time entity.... Source: CoolInterview.com
Answered by: mani | Date: 9/7/2010
| Contact mani
If you have the better answer, then send it to us. We will display your answer after the approval.
Rules to Post Answers in CoolInterview.com:-
- There should not be any Spelling Mistakes.
- There should not be any Gramatical Errors.
- Answers must not contain any bad words.
- Answers should not be the repeat of same answer, already approved.
- Answer should be complete in itself.
|