This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Customer Requirements for Developers and have Marcho Behler on-line!
See this thread for details.
The moose likes Java in General and the fly likes Difference between an Object and Instance. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Customer Requirements for Developers this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Difference between an Object and Instance." Watch "Difference between an Object and Instance." New topic
Author

Difference between an Object and Instance.

Arav Kumar
Greenhorn

Joined: May 27, 2008
Posts: 14
Hi to all Ranchers,

Please explain what is the difference between an Object and Instance, If they are same then why we have different terminologies.

Regards
Arav Kumar.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 43399
    
  32
Please do a search; that question is asked frequently.

An "instance" should really be "an instance of class Foo" which means an object whose type is "Foo". So the two are very similar. An "object" could have any type.
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 20049
    
  30

Also, an Object (with capital O) is an instance of class java.lang.Object.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 43399
    
  32
But all objects are Objects, not like in Eiffel where all objects are Generals and Anys.
Embla Tingeling
Ranch Hand

Joined: Oct 22, 2009
Posts: 237
Arav Kumar wrote:Please explain what is the difference between an Object and Instance, If they are same then why we have different terminologies.


An object is a class instance or an array.
 
 
subject: Difference between an Object and Instance.
 
It's not a secret anymore!