GeekInterview.com
   Home |  Tech FAQ  |   Interview Questions |  Placement Papers |  Tech Articles |  Learn |  Freelance Projects |  Online Testing |  Geeks Talk |  Job Postings |  Knowledge Base | Site Search |  Add/Ask Question

  GeekInterview.com  >  Interview Questions  >  Concepts  >  OOPS

 Print  |  
Question:  What is the Difference between Class and Instance



October 10, 2009 06:45:13 #6
 a_l_soni   Member Since: October 2009    Total Comments: 1 

RE: What is the Difference between Class and Instance
 
Class contains the declaration and definition of all of it member variables and the member functions, along with their respective access specifiers. A Class remains same for all of it's objects or instances.

Object is a mere instantiation of a class. All the member variables and the member functions of a class are used via the object, except the static ones. For every instance/object created of a class a different set of member variables and function references is created. Thus each object has it's own set of member variables. when a function of a class is called on an object, of that class, what all changes/operations/updations are done are specific to that object. Static member variables and static functions are exceptions to this.

     

 

Back To Question