Sponsored Links

Interview Questions



INTERVIEW QUESTIONS C++ C++ BASICS DETAILS

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.

Category C++ Basics Interview Questions & Answers - Exam Mode / Learning Mode
Rating (0.3) By 7715 users
Added on 10/22/2009
Views 86004
Rate it!

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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 Contact velvizhi

class is a collection of data members and member function. Source: CoolInterview.com

Answered by: Manish | Date: 12/7/2009 | Contact Manish 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 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 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 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 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 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 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 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 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 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 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 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 Contact shilpi

Examples:<br>Class:human object:you or me<br> Source: CoolInterview.com

Answered by: pradeep | Date: 5/19/2010 | Contact pradeep 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 Contact vikas

object is run time entity.... Source: CoolInterview.com

Answered by: mani | Date: 9/7/2010 | Contact  mani 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.
Name :*
Email Id :*
Answer :*
Verification Code Code Image - Please contact webmaster if you have problems seeing this image code Not readable? Load New Code
Process Verification Enter the above shown code: *
Inform me about updated answers to this question

Related Questions
View Answer

Please Note: We keep on updating better answers to this site. In case you are looking for Jobs, Pls Click Here Vyoms.com - Best Freshers & Experienced Jobs Website.

View All C++ Basics Interview Questions & Answers - Exam Mode / Learning Mode



User Options
India News Network

Latest 20 Questions
Payment of time- barred debt is: (a) Valid (b) Void (c) Illegal (d) Voidable
Consideration is defined in the Indian Contract Act,1872 in: (a) Section 2(f) (b) Section 2(e) (c) Section 2(g) (d) Section 2(d)
Which of the following is not an exception to the rule, "No consideration, No contract": (a) Natural love and affection (b) Compensation for involuntary services (c) Completed gift (d) Agency
Consideration must move at the desire of: (a) The promisor (b) The promisee (c) The promisor or any other party (d) Both the promisor and the promisee
An offer which is open for acceptance over a period of time is: (a) Cross Offer (b) Counter Offer (c) Standing Offer (d) Implied Offer
Specific offer can be communicated to__________ (a) All the parties of contract (b) General public in universe (c) Specific person (d) None of the above
_________ amounts to rejection of the original offer. (a) Cross offer (b) Special offer (c) Standing offer (d) Counter offer
A advertises to sell his old car by advertising in a newspaper. This offer is caleed: (a) General Offer (b) Special Offer (c) Continuing Offer (d) None of the above
In case a counter offer is made, the original offer stands: (a) Rejected (b) Accepted automatically (c) Accepted subject to certain modifications and variations (d) None of the above
In case of unenforceable contract having some technical defect, parties (a) Can sue upon it (b) Cannot sue upon it (c) Should consider it to be illegal (d) None of the above
If entire specified goods is perished before entering into contract of sale, the contract is (a) Valid (b) Void (c) Voidable (d) Cancelled
______________ contracts are also caled contracts with executed consideration. (a) Unilateral (b) Completed (c) Bilateral (d) Executory
A offers B to supply books @ Rs 100 each but B accepts the same with condition of 10% discount. This is a case of (a) Counter Offer (b) Cross Offer (c) Specific Offer (d) General Offer
_____________ is a game of chance. (a) Conditional Contract (b) Contingent Contract (c) Wagering Contract (d) Quasi Contract
There is no binding contract in case of _______ as one's offer cannot be constructed as acceptance (a) Cross Offer (b) Standing Offer (c) Counter Offer (d) Special Offer
An offer is made with an intention to have negotiation from other party. This type of offer is: (a) Invitation to offer (b) Valid offer (c) Voidable (d) None of the above
When an offer is made to the world at large, it is ____________ offer. (a) Counter (b) Special (c) General (d) None of the above
Implied contract even if not in writing or express words is perfectly _______________ if all the conditions are satisfied:- (a) Void (b) Voidable (c) Valid (d) Illegal
A specific offer can be accepted by ___________. (a) Any person (b) Any friend to offeror (c) The person to whom it is made (d) Any friend of offeree
An agreement toput a fire on a person's car is a ______: (a) Legal (b) Voidable (c) Valid (d) Illegal



Fresher Jobs | Experienced Jobs | Government Jobs | Walkin Jobs | Company Profiles | Interview Questions | Placement Papers | Companies In India | Consultants In India | Colleges In India | Exams In India | Latest Results | Notifications In India | Call Centers In India | Training Institutes In India | Job Communities In India | Courses In India | Jobs by Keyskills | Jobs by Functional Areas

Testing Articles | Testing Books | Testing Certifications | Testing FAQs | Testing Downloads | Testing Interview Questions | Testing Jobs | Testing Training Institutes

Gate Articles | Gate Books | Gate Colleges | Gate Downloads | Gate Faqs | Gate Jobs | Gate News | Gate Sample Papers | Gate Training Institutes

MBA Articles | MBA Books | MBA Case Studies | MBA Business Schools | MBA Current Affairs | MBA Downloads | MBA Events | MBA Notifications | MBA FAQs | MBA Jobs
MBA Job Consultants | MBA News | MBA Results | MBA Courses | MBA Sample Papers | MBA Interview Questions | MBA Training Institutes

GRE Articles | GRE Books | GRE Colleges | GRE Downloads | GRE Events | GRE FAQs | GRE News | GRE Training Institutes | GRE Sample Papers

IAS Articles | IAS Books | IAS Current Affairs | IAS Downloads | IAS Events | IAS FAQs | IAS News | IAS Notifications | IAS UPSC Jobs | IAS Previous Question Papers
IAS Results | IAS Sample Papers | IAS Interview Questions | IAS Training Institutes | IAS Toppers Interview

SAP Articles | SAP Books | SAP Certifications | SAP Companies | SAP Study Materials | SAP Events | SAP FAQs | SAP Jobs | SAP Job Consultants
SAP Links | SAP News | SAP Sample Papers | SAP Interview Questions | SAP Training Institutes |




Copyright ©2003-2025 CoolInterview.com, All Rights Reserved.
Privacy Policy | Terms and Conditions