GeekInterview.com
  I am new, Sign me up!
 
GeekInterview.com  >  Interview Questions  >  J2EE  >  Core Java
Go To First  |  Previous Question  |  Next Question 
 Core Java  |  Question 436 of 502    Print  
What is the difference between an instance and an object in Java?

  
Total Answers and Comments: 4 Last Update: July 04, 2008     Asked by: maharamesh87 
  
 Sponsored Links

 
 Best Rated Answer

No best answer available. Please pick the good answer available or submit your answer.
September 25, 2007 06:25:16   #1  
sanjay        

RE: What is the difference between an instance and an ...
Instance in java...

An actual object of a particular class. An instance of a class is created using the new operator followed by the class name.

Object in java...

When we define a class that does not extend any other class it implicitly extends java.lang.Object. Also an anonymous class based on an interface.

 
Is this answer useful? Yes | No
February 14, 2008 02:21:05   #2  
sampra Member Since: February 2008   Contribution: 278    

RE: What is the difference between an instance and an object in Java?
I think both are same
 
Is this answer useful? Yes | No
April 30, 2008 00:22:17   #3  
AjayMukiri Member Since: April 2008   Contribution: 4    

RE: What is the difference between an instance and an object in Java?
Instance and Object are same as per my knowledge

Creating an Instance of a class is creating an object only

A a new A() --Here "a" is an instance of a class A on same time "a" is an object of Class A.

or

In the other way for creating Instance we use new operator for Object creation also we use new operator. (There are other methods also with which we can create object/instance of a class for a while the above criteria is an eg .)

 
Is this answer useful? Yes | No
July 04, 2008 08:04:53   #4  
raghavleo Member Since: July 2008   Contribution: 1    

RE: What is the difference between an instance and an object in Java?
In general we think instance and objects are same but they are incorrect.

instance will have the both class definiation and the object defination where as

in object it will have only the object defination.

i think this is the correct with my knowledge.

Generally people think object is an instance of class but we can't take this one for

the above answer and they both are different.

 
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