• Post Reply Bookmark Topic Watch Topic
  • New Topic

What is exact difference between object and instance  RSS feed

 
Nagendra Dhulipudi
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
I want to know exact diff between object and instace
 
Campbell Ritchie
Marshal
Posts: 56593
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sounds like a beginner's question.

There isn't a lot of difference, really; they both refer to the same thing.

Any representation of anything in your Java (or other OO) programming is an object; each object derives from a class. When you have an object bar which derives from class Foo, you can say that bar is an instance of [the class] Foo.

That any good?

CR
[ June 14, 2006: Message edited by: Campbell Ritchie ]
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
An instance *of a class* is an object.

An instance of something else isn't an object. For example, in UML a link is an instance of an association. And some people state that Extreme Programming is an instance of the Rational Unified Process. You can also talk of "database instances" etc.

See http://www.google.com/search?q?define:instance
[ June 14, 2006: Message edited by: Ilja Preuss ]
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66307
152
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moved to Java in General (beginner).
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!