• Post Reply Bookmark Topic Watch Topic
  • New Topic

difference btwn Object and Instance  RSS feed

 
Jignesh Wala
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,

Can anybody tell me difference between Object and Instance...?


Thanks.
 
Rahul Bhattacharjee
Ranch Hand
Posts: 2308
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Jignesh Wala:
hi,

Can anybody tell me difference between Object and Instance...?


Thanks.


I think both are same.Instance of a class are objects.You can load the bytes from the .class file to a java.lang.Class class and then make objects out of that.
So you might be refering in java.lang.Class as instance , and the actual stuff created as objects.
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not an advanced question. Moving...
 
Jesper de Jong
Java Cowboy
Sheriff
Posts: 16028
87
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
An object is an instance of a class.

So, there is no difference - they are the same thing.
 
Raguel Koning
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
An Object is created from the blueprint of a class. The class describes how an object will behave. Different instances of an object may exisit with varying properties. I think this is where you get confused between the terms instance and object.
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, actually the term "instance" is more generic.

An instance of a class is an object. An instance of an association is a link. A software development process can be an instance of RUP.

In short, an instance is a concrete realization of a more abstract "template".
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!