GeekInterview.com
  I am new, Sign me up!
 
GeekInterview.com  >  Interview Questions  >  Concepts  >  OOPS
Go To First  |  Previous Question  |  Next Question 
 OOPS  |  Question 26 of 68    Print  
What is the difference between instance and object?

  
Total Answers and Comments: 3 Last Update: September 12, 2008     Asked by: venkateshwar 
  
 Sponsored Links

 
 Best Rated Answer
Submitted by: Pardeep Singh
 

When we create object from a class, it is created on stack or on heap. The existance of an object in memory (stack or heap) is called instance of an object.

Hence Instance and object is used interchangeably.



Above answer was rated as good by the following members:
rajani_vaddepalli15
November 03, 2006 23:47:41   #1  
Pardeep Singh        

RE: What is the difference between instance and object...

When we create object from a class it is created on stack or on heap. The existance of an object in memory (stack or heap) is called instance of an object.

Hence Instance and object is used interchangeably.


 
Is this answer useful? Yes | NoAnswer is useful 1   Answer is not useful 0Overall Rating: +1    
July 16, 2008 07:01:00   #2  
wael.salman Member Since: July 2008   Contribution: 6    

RE: What is the difference between instance and object?
A class is an Abstract Datatype which when instantiated sets aside memory which holds data in fields and references to the instructions for methods.

An instance of a Class is a section of heap memory set aside using the class's template to hold particular data and references back to the shared class instructions stored in the Stack. We access the start of that memory area by using the name of the instance. The runtime engine has calculated the offset from that location to go to the memory location where the individual data or method references are stored.

 
Is this answer useful? Yes | No
September 12, 2008 04:59:08   #3  
adeelqamar8 Member Since: November 2005   Contribution: 2    

RE: What is the difference between instance and object?
When you create a custom type (class) in any language that class in OOP is called Object and when you create an istance of this class just as we create instance of built-in types e.g. (int a float b) it is called instance of the object.
 
Is this answer useful? Yes | No


 
Go To Top


 Sponsored Links

 
About Us -  Privacy Policy -  Terms and Conditions -  Contact -  Ask Question -  Propose Category -  Site Updates 

Copyright © 2005 - 2009 GeekInterview.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape