-4

There can only be one instance of class and can have many objects...? If not then can you please explain me difference between Instance and Object of the class

Barranka
  • 20,547
  • 13
  • 65
  • 83
Ethan Hunt
  • 33
  • 1
  • 3
  • An Object is an instance of a Class. You can think of the object as the thing and "instance" as the relationship. – Peter Lawrey Jul 25 '14 at 13:37
  • possible duplicate of [Difference between object and instance](https://stackoverflow.com/questions/3323330/difference-between-object-and-instance) – ThreeFx Jul 25 '14 at 13:37
  • Read this: [The Java Tutorials: Object Oriented Programming concepts](http://docs.oracle.com/javase/tutorial/java/concepts/index.html)... and also read [this article](http://whathaveyoutried.com) – Barranka Jul 25 '14 at 13:37
  • In other languages, objects can exist without an associated class. In this case there is objects without instances. In Java, all objects must be instances of a class. – Peter Lawrey Jul 25 '14 at 13:39

1 Answers1

0

Instance and object of class are same things.

Theoratically Instance represents certain object at one time.

Example: Suppose you have Employee Class(Structure) with firstName and lastName

your instance or object(Value) represent Employee with firstname "Sanjay" and lastname "Rabari"

Sanjay Rabari
  • 2,091
  • 1
  • 17
  • 32