What is the difference between an Instance and an Object?











up vote
60
down vote

favorite
46












What is the difference between an Instance and an Object?
Is there a difference or not?










share|improve this question




















  • 9




    Maybe you can deduce from the well known error message "Object reference not set to an instance of an object." :->
    – herzmeister
    May 21 '10 at 21:17










  • From JVM spec: "An object is either a dynamically allocated class instance or an array. " docs.oracle.com/javase/specs/jvms/se8/html/jvms-2.html
    – yfklon
    Jul 4 '15 at 7:42










  • StackOverFlow I have just given a brief description on difference between object and instance I hope it helps
    – Pushkarraj Pujari
    Mar 12 '17 at 21:31

















up vote
60
down vote

favorite
46












What is the difference between an Instance and an Object?
Is there a difference or not?










share|improve this question




















  • 9




    Maybe you can deduce from the well known error message "Object reference not set to an instance of an object." :->
    – herzmeister
    May 21 '10 at 21:17










  • From JVM spec: "An object is either a dynamically allocated class instance or an array. " docs.oracle.com/javase/specs/jvms/se8/html/jvms-2.html
    – yfklon
    Jul 4 '15 at 7:42










  • StackOverFlow I have just given a brief description on difference between object and instance I hope it helps
    – Pushkarraj Pujari
    Mar 12 '17 at 21:31















up vote
60
down vote

favorite
46









up vote
60
down vote

favorite
46






46





What is the difference between an Instance and an Object?
Is there a difference or not?










share|improve this question















What is the difference between an Instance and an Object?
Is there a difference or not?







oop object instance






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited May 21 '10 at 20:43









Tim S. Van Haren

8,07622434




8,07622434










asked May 21 '10 at 20:36









streetparade

13.3k3290117




13.3k3290117








  • 9




    Maybe you can deduce from the well known error message "Object reference not set to an instance of an object." :->
    – herzmeister
    May 21 '10 at 21:17










  • From JVM spec: "An object is either a dynamically allocated class instance or an array. " docs.oracle.com/javase/specs/jvms/se8/html/jvms-2.html
    – yfklon
    Jul 4 '15 at 7:42










  • StackOverFlow I have just given a brief description on difference between object and instance I hope it helps
    – Pushkarraj Pujari
    Mar 12 '17 at 21:31
















  • 9




    Maybe you can deduce from the well known error message "Object reference not set to an instance of an object." :->
    – herzmeister
    May 21 '10 at 21:17










  • From JVM spec: "An object is either a dynamically allocated class instance or an array. " docs.oracle.com/javase/specs/jvms/se8/html/jvms-2.html
    – yfklon
    Jul 4 '15 at 7:42










  • StackOverFlow I have just given a brief description on difference between object and instance I hope it helps
    – Pushkarraj Pujari
    Mar 12 '17 at 21:31










9




9




Maybe you can deduce from the well known error message "Object reference not set to an instance of an object." :->
– herzmeister
May 21 '10 at 21:17




Maybe you can deduce from the well known error message "Object reference not set to an instance of an object." :->
– herzmeister
May 21 '10 at 21:17












From JVM spec: "An object is either a dynamically allocated class instance or an array. " docs.oracle.com/javase/specs/jvms/se8/html/jvms-2.html
– yfklon
Jul 4 '15 at 7:42




From JVM spec: "An object is either a dynamically allocated class instance or an array. " docs.oracle.com/javase/specs/jvms/se8/html/jvms-2.html
– yfklon
Jul 4 '15 at 7:42












StackOverFlow I have just given a brief description on difference between object and instance I hope it helps
– Pushkarraj Pujari
Mar 12 '17 at 21:31






StackOverFlow I have just given a brief description on difference between object and instance I hope it helps
– Pushkarraj Pujari
Mar 12 '17 at 21:31














15 Answers
15






active

oldest

votes

















up vote
41
down vote



accepted










An instance is an object in memory. Basically you create object and instantiate them when you are using them.



Here is a nice writeup on Classes Vs Objects Vs Instances, he is talking Java but it applies to all OO.



http://alfredjava.wordpress.com/2008/07/08/class-vs-object-vs-instance/






share|improve this answer

















  • 8




    This blog post explains nothing.
    – Koray Tugay
    Nov 17 '17 at 13:30


















up vote
38
down vote













There's no real significant difference that should consume too much of your time. There might be some fancy language that some people might take up a lot of spaces to write about, but at the end of the day, as far as a coder, developer, programmer, architect, is concerned, an instance of a class and an object mean the same thing and can often be used interchangeably. I have never met anyone in my career that would be picky and spend half hour trying to point out the differences, because there's really none. Time can be better spent on other development efforts.



UPDATE With regards to Swift, this is what Apple who invented Swift prefers :




An instance of a class is traditionally known as an object. However,
Swift classes and structures are much closer in functionality than in
other languages, and much of this chapter describes functionality that
can apply to instances of either a class or a structure type. Because
of this, the more general term instance is used.







share|improve this answer






























    up vote
    28
    down vote













    Excellent question.



    I'll explain it in the simplest way possible:
    Say you have 5 apples in your basket. Each of those apples is an object of type Apple, which has some characteristics (i.e. big, round, grows on trees).



    In programming terms, you can have a class called Apple, which has variables size:big, shape:round, habitat:grows on trees. To have 5 apples in your basket, you need to instantiate 5 apples. Apple apple1, Apple apple2, Apple apple3 etc....



    Alternatively: Objects are the definitions of something, instances are the physical things.



    Does this make sense?






    share|improve this answer

















    • 37




      It doesn't. :) "Objects are the definitions of something" What you call objects here are classes.
      – T-Gergely
      Feb 10 '16 at 9:50










    • Downvote since I agree with the comment above.
      – khituras
      Mar 1 at 9:08


















    up vote
    8
    down vote













    Instance: instance means just creating a reference(copy).



    object: means when memory location is associated with the object (is a run-time entity of the class) by using the new operator.



    In simple words, Instance refers to the copy of the object at a particular time whereas object refers to the memory address of the class.






    share|improve this answer



















    • 1




      saying that an instance is a reference to an object really cleared things up for me.
      – John C
      May 31 '17 at 22:36


















    up vote
    7
    down vote













    Let's say you're building some chairs.



    The diagram that shows how to build a chair and put it together corresponds to a software class.



    Let's say you build five chairs according to the pattern in that diagram. Likewise, you could construct five software objects according to the pattern in a class.



    Each chair has a unique number burned into the bottom of the seat to identify each specific chair. Chair 3 is one instance of a chair object. Likewise, memory location 3 can contain one instance of a software object.



    So, an instance (chair 3) is a single unique, specific representation of an object (a chair).






    share|improve this answer




























      up vote
      5
      down vote













      Object:



      It is a generice term basically it is a Software bundle that has state(variables) and behaviour(methods)



      Class:



      A blue print(template) for an object
      instance-it's a unique object thing for example you create a object two times what does that mean is yo have created two instances



      Let me give an example



      Class student()
      {
      private string firstName;
      public student(string fname)
      {
      firstName=fname;
      }
      Public string GetFirstName()
      {
      return firstName;
      }
      }


      Object example:



      Student s1=new student("Martin");
      Student s2=new student("Kumar");



      The s1,s2 are having object of class Student



      Instance:



      s1 and s2 are instances of object student
      the two are unique.



      it can be called as reference also.



      basically the s1 and s2 are variables that are assigned an object






      share|improve this answer






























        up vote
        4
        down vote













        Objects and instances are mostly same; but having very small difference.
        If "car" is a class; 3 cars are 3 different objects. All these objects are instances. So these 3 cars are objects frominstances of "car" class.



        But the word "instance" can be "structure instances" also. But object is only for classes.



        All the objects are instances.
        All the instances may not be objects. Instances may be "structure instances" or "objects".






        share|improve this answer






























          up vote
          4
          down vote













          An object is a construct, something static that has certain features and traits, such as properties and methods, it can be anything (a string, a usercontrol, etc)



          An instance is a unique copy of that object that you can use and do things with.



          Imagine a product like a computer.



          THE xw6400 workstation is an object



          YOUR xw6400 workstation, (or YOUR WIFE's xw6400 workstation) is an instance of the xw6400 workstation object






          share|improve this answer






























            up vote
            2
            down vote













            An instance is a specific representation of an object. An object is a generic thing while an instance is a single object that has been created in memory. Usually an instance will have values assigned to it's properties that differentiates it from other instances of the type of object.






            share|improve this answer




























              up vote
              2
              down vote













              Object - An instance of a class that has its own state and access to all of the behaviour defined by its class.



              Instance - Reference to an memory area for that particular class.






              share|improve this answer




























                up vote
                1
                down vote













                each object said to be an instance of its class but each instance of the class has its own value for each attributes
                intances shares the attribute name and operation with their intances of class but an object contains an implicit reference to his on class






                share|improve this answer




























                  up vote
                  1
                  down vote













                  If we see the Definition of Object and Instance object -



                  Memory allocated for the member of class at run time is called object or object is the instance of Class.



                  Let us see the Definition of instance -



                  Memory allocated For Any at run time is called as instance variable.



                  Now understand the meaning of any run time memory allocation happen in C also through Malloc, Calloc, Realloc such:



                  struct p
                  {

                  }
                  p *t1
                  t1=(p) malloc(sizeof(p))


                  So here also we are allocating run time memory allocation but here we call as instance so t1 is instance here we can not say t1 as object so Every object is the instance of Class but every Instance is not Object.






                  share|improve this answer






























                    up vote
                    0
                    down vote













                    An object can be a class, say you have a class called basketball.



                    but you want to have multiple basketballs so in your code you create more than 1 basketball



                    say basketball1 and basketball2.
                    Then you run your application.
                    You now have 2 instances of the object basketball.






                    share|improve this answer





















                    • That would mean a Object is a Instance of a Class Constructor ?
                      – streetparade
                      May 21 '10 at 20:47










                    • think of the object like a blueprint. say we have a blueprint for the basketball, that is the class. when the basketball is created and made it now exists, so that would mean we have 1 instance of the object basketball. if we built another basketball from the object(blueprint). we now have 2 instances of the basketball. There is always just 1 object, but we can make many instances of that object.
                      – Darxval
                      May 21 '10 at 21:08


















                    up vote
                    0
                    down vote













                    Class : A class is a blue print.
                    Object : It is the copy of the class.
                    Instance : Its a variable which is used to hold memory address of the object.



                    A very basic analytical example



                    Class House --> Blueprint of the house. But you can't live in the blue print. You need a physical House which is the instance of the class to live in. i.e., actual address of the object is instance. Instances represent objects.






                    share|improve this answer




























                      up vote
                      -2
                      down vote













                      Object refers to class and instance refers to an object.In other words instance is a copy of an object with particular values in it.






                      share|improve this answer




















                        protected by Stephen C Mar 26 '17 at 5:17



                        Thank you for your interest in this question.
                        Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).



                        Would you like to answer one of these unanswered questions instead?














                        15 Answers
                        15






                        active

                        oldest

                        votes








                        15 Answers
                        15






                        active

                        oldest

                        votes









                        active

                        oldest

                        votes






                        active

                        oldest

                        votes








                        up vote
                        41
                        down vote



                        accepted










                        An instance is an object in memory. Basically you create object and instantiate them when you are using them.



                        Here is a nice writeup on Classes Vs Objects Vs Instances, he is talking Java but it applies to all OO.



                        http://alfredjava.wordpress.com/2008/07/08/class-vs-object-vs-instance/






                        share|improve this answer

















                        • 8




                          This blog post explains nothing.
                          – Koray Tugay
                          Nov 17 '17 at 13:30















                        up vote
                        41
                        down vote



                        accepted










                        An instance is an object in memory. Basically you create object and instantiate them when you are using them.



                        Here is a nice writeup on Classes Vs Objects Vs Instances, he is talking Java but it applies to all OO.



                        http://alfredjava.wordpress.com/2008/07/08/class-vs-object-vs-instance/






                        share|improve this answer

















                        • 8




                          This blog post explains nothing.
                          – Koray Tugay
                          Nov 17 '17 at 13:30













                        up vote
                        41
                        down vote



                        accepted







                        up vote
                        41
                        down vote



                        accepted






                        An instance is an object in memory. Basically you create object and instantiate them when you are using them.



                        Here is a nice writeup on Classes Vs Objects Vs Instances, he is talking Java but it applies to all OO.



                        http://alfredjava.wordpress.com/2008/07/08/class-vs-object-vs-instance/






                        share|improve this answer












                        An instance is an object in memory. Basically you create object and instantiate them when you are using them.



                        Here is a nice writeup on Classes Vs Objects Vs Instances, he is talking Java but it applies to all OO.



                        http://alfredjava.wordpress.com/2008/07/08/class-vs-object-vs-instance/







                        share|improve this answer












                        share|improve this answer



                        share|improve this answer










                        answered May 21 '10 at 20:38









                        Dustin Laine

                        31.5k872108




                        31.5k872108








                        • 8




                          This blog post explains nothing.
                          – Koray Tugay
                          Nov 17 '17 at 13:30














                        • 8




                          This blog post explains nothing.
                          – Koray Tugay
                          Nov 17 '17 at 13:30








                        8




                        8




                        This blog post explains nothing.
                        – Koray Tugay
                        Nov 17 '17 at 13:30




                        This blog post explains nothing.
                        – Koray Tugay
                        Nov 17 '17 at 13:30












                        up vote
                        38
                        down vote













                        There's no real significant difference that should consume too much of your time. There might be some fancy language that some people might take up a lot of spaces to write about, but at the end of the day, as far as a coder, developer, programmer, architect, is concerned, an instance of a class and an object mean the same thing and can often be used interchangeably. I have never met anyone in my career that would be picky and spend half hour trying to point out the differences, because there's really none. Time can be better spent on other development efforts.



                        UPDATE With regards to Swift, this is what Apple who invented Swift prefers :




                        An instance of a class is traditionally known as an object. However,
                        Swift classes and structures are much closer in functionality than in
                        other languages, and much of this chapter describes functionality that
                        can apply to instances of either a class or a structure type. Because
                        of this, the more general term instance is used.







                        share|improve this answer



























                          up vote
                          38
                          down vote













                          There's no real significant difference that should consume too much of your time. There might be some fancy language that some people might take up a lot of spaces to write about, but at the end of the day, as far as a coder, developer, programmer, architect, is concerned, an instance of a class and an object mean the same thing and can often be used interchangeably. I have never met anyone in my career that would be picky and spend half hour trying to point out the differences, because there's really none. Time can be better spent on other development efforts.



                          UPDATE With regards to Swift, this is what Apple who invented Swift prefers :




                          An instance of a class is traditionally known as an object. However,
                          Swift classes and structures are much closer in functionality than in
                          other languages, and much of this chapter describes functionality that
                          can apply to instances of either a class or a structure type. Because
                          of this, the more general term instance is used.







                          share|improve this answer

























                            up vote
                            38
                            down vote










                            up vote
                            38
                            down vote









                            There's no real significant difference that should consume too much of your time. There might be some fancy language that some people might take up a lot of spaces to write about, but at the end of the day, as far as a coder, developer, programmer, architect, is concerned, an instance of a class and an object mean the same thing and can often be used interchangeably. I have never met anyone in my career that would be picky and spend half hour trying to point out the differences, because there's really none. Time can be better spent on other development efforts.



                            UPDATE With regards to Swift, this is what Apple who invented Swift prefers :




                            An instance of a class is traditionally known as an object. However,
                            Swift classes and structures are much closer in functionality than in
                            other languages, and much of this chapter describes functionality that
                            can apply to instances of either a class or a structure type. Because
                            of this, the more general term instance is used.







                            share|improve this answer














                            There's no real significant difference that should consume too much of your time. There might be some fancy language that some people might take up a lot of spaces to write about, but at the end of the day, as far as a coder, developer, programmer, architect, is concerned, an instance of a class and an object mean the same thing and can often be used interchangeably. I have never met anyone in my career that would be picky and spend half hour trying to point out the differences, because there's really none. Time can be better spent on other development efforts.



                            UPDATE With regards to Swift, this is what Apple who invented Swift prefers :




                            An instance of a class is traditionally known as an object. However,
                            Swift classes and structures are much closer in functionality than in
                            other languages, and much of this chapter describes functionality that
                            can apply to instances of either a class or a structure type. Because
                            of this, the more general term instance is used.








                            share|improve this answer














                            share|improve this answer



                            share|improve this answer








                            edited Oct 20 '14 at 14:32

























                            answered May 21 '10 at 20:52









                            Kevin Le - Khnle

                            6,40564070




                            6,40564070






















                                up vote
                                28
                                down vote













                                Excellent question.



                                I'll explain it in the simplest way possible:
                                Say you have 5 apples in your basket. Each of those apples is an object of type Apple, which has some characteristics (i.e. big, round, grows on trees).



                                In programming terms, you can have a class called Apple, which has variables size:big, shape:round, habitat:grows on trees. To have 5 apples in your basket, you need to instantiate 5 apples. Apple apple1, Apple apple2, Apple apple3 etc....



                                Alternatively: Objects are the definitions of something, instances are the physical things.



                                Does this make sense?






                                share|improve this answer

















                                • 37




                                  It doesn't. :) "Objects are the definitions of something" What you call objects here are classes.
                                  – T-Gergely
                                  Feb 10 '16 at 9:50










                                • Downvote since I agree with the comment above.
                                  – khituras
                                  Mar 1 at 9:08















                                up vote
                                28
                                down vote













                                Excellent question.



                                I'll explain it in the simplest way possible:
                                Say you have 5 apples in your basket. Each of those apples is an object of type Apple, which has some characteristics (i.e. big, round, grows on trees).



                                In programming terms, you can have a class called Apple, which has variables size:big, shape:round, habitat:grows on trees. To have 5 apples in your basket, you need to instantiate 5 apples. Apple apple1, Apple apple2, Apple apple3 etc....



                                Alternatively: Objects are the definitions of something, instances are the physical things.



                                Does this make sense?






                                share|improve this answer

















                                • 37




                                  It doesn't. :) "Objects are the definitions of something" What you call objects here are classes.
                                  – T-Gergely
                                  Feb 10 '16 at 9:50










                                • Downvote since I agree with the comment above.
                                  – khituras
                                  Mar 1 at 9:08













                                up vote
                                28
                                down vote










                                up vote
                                28
                                down vote









                                Excellent question.



                                I'll explain it in the simplest way possible:
                                Say you have 5 apples in your basket. Each of those apples is an object of type Apple, which has some characteristics (i.e. big, round, grows on trees).



                                In programming terms, you can have a class called Apple, which has variables size:big, shape:round, habitat:grows on trees. To have 5 apples in your basket, you need to instantiate 5 apples. Apple apple1, Apple apple2, Apple apple3 etc....



                                Alternatively: Objects are the definitions of something, instances are the physical things.



                                Does this make sense?






                                share|improve this answer












                                Excellent question.



                                I'll explain it in the simplest way possible:
                                Say you have 5 apples in your basket. Each of those apples is an object of type Apple, which has some characteristics (i.e. big, round, grows on trees).



                                In programming terms, you can have a class called Apple, which has variables size:big, shape:round, habitat:grows on trees. To have 5 apples in your basket, you need to instantiate 5 apples. Apple apple1, Apple apple2, Apple apple3 etc....



                                Alternatively: Objects are the definitions of something, instances are the physical things.



                                Does this make sense?







                                share|improve this answer












                                share|improve this answer



                                share|improve this answer










                                answered May 21 '10 at 20:51









                                Yuval Karmi

                                12k34107167




                                12k34107167








                                • 37




                                  It doesn't. :) "Objects are the definitions of something" What you call objects here are classes.
                                  – T-Gergely
                                  Feb 10 '16 at 9:50










                                • Downvote since I agree with the comment above.
                                  – khituras
                                  Mar 1 at 9:08














                                • 37




                                  It doesn't. :) "Objects are the definitions of something" What you call objects here are classes.
                                  – T-Gergely
                                  Feb 10 '16 at 9:50










                                • Downvote since I agree with the comment above.
                                  – khituras
                                  Mar 1 at 9:08








                                37




                                37




                                It doesn't. :) "Objects are the definitions of something" What you call objects here are classes.
                                – T-Gergely
                                Feb 10 '16 at 9:50




                                It doesn't. :) "Objects are the definitions of something" What you call objects here are classes.
                                – T-Gergely
                                Feb 10 '16 at 9:50












                                Downvote since I agree with the comment above.
                                – khituras
                                Mar 1 at 9:08




                                Downvote since I agree with the comment above.
                                – khituras
                                Mar 1 at 9:08










                                up vote
                                8
                                down vote













                                Instance: instance means just creating a reference(copy).



                                object: means when memory location is associated with the object (is a run-time entity of the class) by using the new operator.



                                In simple words, Instance refers to the copy of the object at a particular time whereas object refers to the memory address of the class.






                                share|improve this answer



















                                • 1




                                  saying that an instance is a reference to an object really cleared things up for me.
                                  – John C
                                  May 31 '17 at 22:36















                                up vote
                                8
                                down vote













                                Instance: instance means just creating a reference(copy).



                                object: means when memory location is associated with the object (is a run-time entity of the class) by using the new operator.



                                In simple words, Instance refers to the copy of the object at a particular time whereas object refers to the memory address of the class.






                                share|improve this answer



















                                • 1




                                  saying that an instance is a reference to an object really cleared things up for me.
                                  – John C
                                  May 31 '17 at 22:36













                                up vote
                                8
                                down vote










                                up vote
                                8
                                down vote









                                Instance: instance means just creating a reference(copy).



                                object: means when memory location is associated with the object (is a run-time entity of the class) by using the new operator.



                                In simple words, Instance refers to the copy of the object at a particular time whereas object refers to the memory address of the class.






                                share|improve this answer














                                Instance: instance means just creating a reference(copy).



                                object: means when memory location is associated with the object (is a run-time entity of the class) by using the new operator.



                                In simple words, Instance refers to the copy of the object at a particular time whereas object refers to the memory address of the class.







                                share|improve this answer














                                share|improve this answer



                                share|improve this answer








                                edited Dec 16 '13 at 16:52


























                                community wiki





                                2 revs, 2 users 80%
                                karthik reddy









                                • 1




                                  saying that an instance is a reference to an object really cleared things up for me.
                                  – John C
                                  May 31 '17 at 22:36














                                • 1




                                  saying that an instance is a reference to an object really cleared things up for me.
                                  – John C
                                  May 31 '17 at 22:36








                                1




                                1




                                saying that an instance is a reference to an object really cleared things up for me.
                                – John C
                                May 31 '17 at 22:36




                                saying that an instance is a reference to an object really cleared things up for me.
                                – John C
                                May 31 '17 at 22:36










                                up vote
                                7
                                down vote













                                Let's say you're building some chairs.



                                The diagram that shows how to build a chair and put it together corresponds to a software class.



                                Let's say you build five chairs according to the pattern in that diagram. Likewise, you could construct five software objects according to the pattern in a class.



                                Each chair has a unique number burned into the bottom of the seat to identify each specific chair. Chair 3 is one instance of a chair object. Likewise, memory location 3 can contain one instance of a software object.



                                So, an instance (chair 3) is a single unique, specific representation of an object (a chair).






                                share|improve this answer

























                                  up vote
                                  7
                                  down vote













                                  Let's say you're building some chairs.



                                  The diagram that shows how to build a chair and put it together corresponds to a software class.



                                  Let's say you build five chairs according to the pattern in that diagram. Likewise, you could construct five software objects according to the pattern in a class.



                                  Each chair has a unique number burned into the bottom of the seat to identify each specific chair. Chair 3 is one instance of a chair object. Likewise, memory location 3 can contain one instance of a software object.



                                  So, an instance (chair 3) is a single unique, specific representation of an object (a chair).






                                  share|improve this answer























                                    up vote
                                    7
                                    down vote










                                    up vote
                                    7
                                    down vote









                                    Let's say you're building some chairs.



                                    The diagram that shows how to build a chair and put it together corresponds to a software class.



                                    Let's say you build five chairs according to the pattern in that diagram. Likewise, you could construct five software objects according to the pattern in a class.



                                    Each chair has a unique number burned into the bottom of the seat to identify each specific chair. Chair 3 is one instance of a chair object. Likewise, memory location 3 can contain one instance of a software object.



                                    So, an instance (chair 3) is a single unique, specific representation of an object (a chair).






                                    share|improve this answer












                                    Let's say you're building some chairs.



                                    The diagram that shows how to build a chair and put it together corresponds to a software class.



                                    Let's say you build five chairs according to the pattern in that diagram. Likewise, you could construct five software objects according to the pattern in a class.



                                    Each chair has a unique number burned into the bottom of the seat to identify each specific chair. Chair 3 is one instance of a chair object. Likewise, memory location 3 can contain one instance of a software object.



                                    So, an instance (chair 3) is a single unique, specific representation of an object (a chair).







                                    share|improve this answer












                                    share|improve this answer



                                    share|improve this answer










                                    answered May 21 '10 at 21:03









                                    Brian Showalter

                                    3,58721926




                                    3,58721926






















                                        up vote
                                        5
                                        down vote













                                        Object:



                                        It is a generice term basically it is a Software bundle that has state(variables) and behaviour(methods)



                                        Class:



                                        A blue print(template) for an object
                                        instance-it's a unique object thing for example you create a object two times what does that mean is yo have created two instances



                                        Let me give an example



                                        Class student()
                                        {
                                        private string firstName;
                                        public student(string fname)
                                        {
                                        firstName=fname;
                                        }
                                        Public string GetFirstName()
                                        {
                                        return firstName;
                                        }
                                        }


                                        Object example:



                                        Student s1=new student("Martin");
                                        Student s2=new student("Kumar");



                                        The s1,s2 are having object of class Student



                                        Instance:



                                        s1 and s2 are instances of object student
                                        the two are unique.



                                        it can be called as reference also.



                                        basically the s1 and s2 are variables that are assigned an object






                                        share|improve this answer



























                                          up vote
                                          5
                                          down vote













                                          Object:



                                          It is a generice term basically it is a Software bundle that has state(variables) and behaviour(methods)



                                          Class:



                                          A blue print(template) for an object
                                          instance-it's a unique object thing for example you create a object two times what does that mean is yo have created two instances



                                          Let me give an example



                                          Class student()
                                          {
                                          private string firstName;
                                          public student(string fname)
                                          {
                                          firstName=fname;
                                          }
                                          Public string GetFirstName()
                                          {
                                          return firstName;
                                          }
                                          }


                                          Object example:



                                          Student s1=new student("Martin");
                                          Student s2=new student("Kumar");



                                          The s1,s2 are having object of class Student



                                          Instance:



                                          s1 and s2 are instances of object student
                                          the two are unique.



                                          it can be called as reference also.



                                          basically the s1 and s2 are variables that are assigned an object






                                          share|improve this answer

























                                            up vote
                                            5
                                            down vote










                                            up vote
                                            5
                                            down vote









                                            Object:



                                            It is a generice term basically it is a Software bundle that has state(variables) and behaviour(methods)



                                            Class:



                                            A blue print(template) for an object
                                            instance-it's a unique object thing for example you create a object two times what does that mean is yo have created two instances



                                            Let me give an example



                                            Class student()
                                            {
                                            private string firstName;
                                            public student(string fname)
                                            {
                                            firstName=fname;
                                            }
                                            Public string GetFirstName()
                                            {
                                            return firstName;
                                            }
                                            }


                                            Object example:



                                            Student s1=new student("Martin");
                                            Student s2=new student("Kumar");



                                            The s1,s2 are having object of class Student



                                            Instance:



                                            s1 and s2 are instances of object student
                                            the two are unique.



                                            it can be called as reference also.



                                            basically the s1 and s2 are variables that are assigned an object






                                            share|improve this answer














                                            Object:



                                            It is a generice term basically it is a Software bundle that has state(variables) and behaviour(methods)



                                            Class:



                                            A blue print(template) for an object
                                            instance-it's a unique object thing for example you create a object two times what does that mean is yo have created two instances



                                            Let me give an example



                                            Class student()
                                            {
                                            private string firstName;
                                            public student(string fname)
                                            {
                                            firstName=fname;
                                            }
                                            Public string GetFirstName()
                                            {
                                            return firstName;
                                            }
                                            }


                                            Object example:



                                            Student s1=new student("Martin");
                                            Student s2=new student("Kumar");



                                            The s1,s2 are having object of class Student



                                            Instance:



                                            s1 and s2 are instances of object student
                                            the two are unique.



                                            it can be called as reference also.



                                            basically the s1 and s2 are variables that are assigned an object







                                            share|improve this answer














                                            share|improve this answer



                                            share|improve this answer








                                            edited Aug 14 '14 at 13:29









                                            Shajo

                                            5301620




                                            5301620










                                            answered Mar 22 '13 at 15:33









                                            Durai Amuthan.H

                                            22k4116198




                                            22k4116198






















                                                up vote
                                                4
                                                down vote













                                                Objects and instances are mostly same; but having very small difference.
                                                If "car" is a class; 3 cars are 3 different objects. All these objects are instances. So these 3 cars are objects frominstances of "car" class.



                                                But the word "instance" can be "structure instances" also. But object is only for classes.



                                                All the objects are instances.
                                                All the instances may not be objects. Instances may be "structure instances" or "objects".






                                                share|improve this answer



























                                                  up vote
                                                  4
                                                  down vote













                                                  Objects and instances are mostly same; but having very small difference.
                                                  If "car" is a class; 3 cars are 3 different objects. All these objects are instances. So these 3 cars are objects frominstances of "car" class.



                                                  But the word "instance" can be "structure instances" also. But object is only for classes.



                                                  All the objects are instances.
                                                  All the instances may not be objects. Instances may be "structure instances" or "objects".






                                                  share|improve this answer

























                                                    up vote
                                                    4
                                                    down vote










                                                    up vote
                                                    4
                                                    down vote









                                                    Objects and instances are mostly same; but having very small difference.
                                                    If "car" is a class; 3 cars are 3 different objects. All these objects are instances. So these 3 cars are objects frominstances of "car" class.



                                                    But the word "instance" can be "structure instances" also. But object is only for classes.



                                                    All the objects are instances.
                                                    All the instances may not be objects. Instances may be "structure instances" or "objects".






                                                    share|improve this answer














                                                    Objects and instances are mostly same; but having very small difference.
                                                    If "car" is a class; 3 cars are 3 different objects. All these objects are instances. So these 3 cars are objects frominstances of "car" class.



                                                    But the word "instance" can be "structure instances" also. But object is only for classes.



                                                    All the objects are instances.
                                                    All the instances may not be objects. Instances may be "structure instances" or "objects".







                                                    share|improve this answer














                                                    share|improve this answer



                                                    share|improve this answer








                                                    edited Mar 1 '16 at 10:10









                                                    KittMedia

                                                    5,389102433




                                                    5,389102433










                                                    answered Mar 1 '16 at 10:00









                                                    DotNet Harsha Vardhan

                                                    4111




                                                    4111






















                                                        up vote
                                                        4
                                                        down vote













                                                        An object is a construct, something static that has certain features and traits, such as properties and methods, it can be anything (a string, a usercontrol, etc)



                                                        An instance is a unique copy of that object that you can use and do things with.



                                                        Imagine a product like a computer.



                                                        THE xw6400 workstation is an object



                                                        YOUR xw6400 workstation, (or YOUR WIFE's xw6400 workstation) is an instance of the xw6400 workstation object






                                                        share|improve this answer



























                                                          up vote
                                                          4
                                                          down vote













                                                          An object is a construct, something static that has certain features and traits, such as properties and methods, it can be anything (a string, a usercontrol, etc)



                                                          An instance is a unique copy of that object that you can use and do things with.



                                                          Imagine a product like a computer.



                                                          THE xw6400 workstation is an object



                                                          YOUR xw6400 workstation, (or YOUR WIFE's xw6400 workstation) is an instance of the xw6400 workstation object






                                                          share|improve this answer

























                                                            up vote
                                                            4
                                                            down vote










                                                            up vote
                                                            4
                                                            down vote









                                                            An object is a construct, something static that has certain features and traits, such as properties and methods, it can be anything (a string, a usercontrol, etc)



                                                            An instance is a unique copy of that object that you can use and do things with.



                                                            Imagine a product like a computer.



                                                            THE xw6400 workstation is an object



                                                            YOUR xw6400 workstation, (or YOUR WIFE's xw6400 workstation) is an instance of the xw6400 workstation object






                                                            share|improve this answer














                                                            An object is a construct, something static that has certain features and traits, such as properties and methods, it can be anything (a string, a usercontrol, etc)



                                                            An instance is a unique copy of that object that you can use and do things with.



                                                            Imagine a product like a computer.



                                                            THE xw6400 workstation is an object



                                                            YOUR xw6400 workstation, (or YOUR WIFE's xw6400 workstation) is an instance of the xw6400 workstation object







                                                            share|improve this answer














                                                            share|improve this answer



                                                            share|improve this answer








                                                            edited Nov 6 '16 at 11:40









                                                            Luís Cruz

                                                            10.8k124973




                                                            10.8k124973










                                                            answered May 21 '10 at 20:41









                                                            Greg Olmstead

                                                            1,368922




                                                            1,368922






















                                                                up vote
                                                                2
                                                                down vote













                                                                An instance is a specific representation of an object. An object is a generic thing while an instance is a single object that has been created in memory. Usually an instance will have values assigned to it's properties that differentiates it from other instances of the type of object.






                                                                share|improve this answer

























                                                                  up vote
                                                                  2
                                                                  down vote













                                                                  An instance is a specific representation of an object. An object is a generic thing while an instance is a single object that has been created in memory. Usually an instance will have values assigned to it's properties that differentiates it from other instances of the type of object.






                                                                  share|improve this answer























                                                                    up vote
                                                                    2
                                                                    down vote










                                                                    up vote
                                                                    2
                                                                    down vote









                                                                    An instance is a specific representation of an object. An object is a generic thing while an instance is a single object that has been created in memory. Usually an instance will have values assigned to it's properties that differentiates it from other instances of the type of object.






                                                                    share|improve this answer












                                                                    An instance is a specific representation of an object. An object is a generic thing while an instance is a single object that has been created in memory. Usually an instance will have values assigned to it's properties that differentiates it from other instances of the type of object.







                                                                    share|improve this answer












                                                                    share|improve this answer



                                                                    share|improve this answer










                                                                    answered May 21 '10 at 20:42









                                                                    TLiebe

                                                                    7,39211826




                                                                    7,39211826






















                                                                        up vote
                                                                        2
                                                                        down vote













                                                                        Object - An instance of a class that has its own state and access to all of the behaviour defined by its class.



                                                                        Instance - Reference to an memory area for that particular class.






                                                                        share|improve this answer

























                                                                          up vote
                                                                          2
                                                                          down vote













                                                                          Object - An instance of a class that has its own state and access to all of the behaviour defined by its class.



                                                                          Instance - Reference to an memory area for that particular class.






                                                                          share|improve this answer























                                                                            up vote
                                                                            2
                                                                            down vote










                                                                            up vote
                                                                            2
                                                                            down vote









                                                                            Object - An instance of a class that has its own state and access to all of the behaviour defined by its class.



                                                                            Instance - Reference to an memory area for that particular class.






                                                                            share|improve this answer












                                                                            Object - An instance of a class that has its own state and access to all of the behaviour defined by its class.



                                                                            Instance - Reference to an memory area for that particular class.







                                                                            share|improve this answer












                                                                            share|improve this answer



                                                                            share|improve this answer










                                                                            answered Oct 20 '14 at 11:10









                                                                            prathipati s

                                                                            211




                                                                            211






















                                                                                up vote
                                                                                1
                                                                                down vote













                                                                                each object said to be an instance of its class but each instance of the class has its own value for each attributes
                                                                                intances shares the attribute name and operation with their intances of class but an object contains an implicit reference to his on class






                                                                                share|improve this answer

























                                                                                  up vote
                                                                                  1
                                                                                  down vote













                                                                                  each object said to be an instance of its class but each instance of the class has its own value for each attributes
                                                                                  intances shares the attribute name and operation with their intances of class but an object contains an implicit reference to his on class






                                                                                  share|improve this answer























                                                                                    up vote
                                                                                    1
                                                                                    down vote










                                                                                    up vote
                                                                                    1
                                                                                    down vote









                                                                                    each object said to be an instance of its class but each instance of the class has its own value for each attributes
                                                                                    intances shares the attribute name and operation with their intances of class but an object contains an implicit reference to his on class






                                                                                    share|improve this answer












                                                                                    each object said to be an instance of its class but each instance of the class has its own value for each attributes
                                                                                    intances shares the attribute name and operation with their intances of class but an object contains an implicit reference to his on class







                                                                                    share|improve this answer












                                                                                    share|improve this answer



                                                                                    share|improve this answer










                                                                                    answered Sep 5 '13 at 11:39









                                                                                    user2750565

                                                                                    111




                                                                                    111






















                                                                                        up vote
                                                                                        1
                                                                                        down vote













                                                                                        If we see the Definition of Object and Instance object -



                                                                                        Memory allocated for the member of class at run time is called object or object is the instance of Class.



                                                                                        Let us see the Definition of instance -



                                                                                        Memory allocated For Any at run time is called as instance variable.



                                                                                        Now understand the meaning of any run time memory allocation happen in C also through Malloc, Calloc, Realloc such:



                                                                                        struct p
                                                                                        {

                                                                                        }
                                                                                        p *t1
                                                                                        t1=(p) malloc(sizeof(p))


                                                                                        So here also we are allocating run time memory allocation but here we call as instance so t1 is instance here we can not say t1 as object so Every object is the instance of Class but every Instance is not Object.






                                                                                        share|improve this answer



























                                                                                          up vote
                                                                                          1
                                                                                          down vote













                                                                                          If we see the Definition of Object and Instance object -



                                                                                          Memory allocated for the member of class at run time is called object or object is the instance of Class.



                                                                                          Let us see the Definition of instance -



                                                                                          Memory allocated For Any at run time is called as instance variable.



                                                                                          Now understand the meaning of any run time memory allocation happen in C also through Malloc, Calloc, Realloc such:



                                                                                          struct p
                                                                                          {

                                                                                          }
                                                                                          p *t1
                                                                                          t1=(p) malloc(sizeof(p))


                                                                                          So here also we are allocating run time memory allocation but here we call as instance so t1 is instance here we can not say t1 as object so Every object is the instance of Class but every Instance is not Object.






                                                                                          share|improve this answer

























                                                                                            up vote
                                                                                            1
                                                                                            down vote










                                                                                            up vote
                                                                                            1
                                                                                            down vote









                                                                                            If we see the Definition of Object and Instance object -



                                                                                            Memory allocated for the member of class at run time is called object or object is the instance of Class.



                                                                                            Let us see the Definition of instance -



                                                                                            Memory allocated For Any at run time is called as instance variable.



                                                                                            Now understand the meaning of any run time memory allocation happen in C also through Malloc, Calloc, Realloc such:



                                                                                            struct p
                                                                                            {

                                                                                            }
                                                                                            p *t1
                                                                                            t1=(p) malloc(sizeof(p))


                                                                                            So here also we are allocating run time memory allocation but here we call as instance so t1 is instance here we can not say t1 as object so Every object is the instance of Class but every Instance is not Object.






                                                                                            share|improve this answer














                                                                                            If we see the Definition of Object and Instance object -



                                                                                            Memory allocated for the member of class at run time is called object or object is the instance of Class.



                                                                                            Let us see the Definition of instance -



                                                                                            Memory allocated For Any at run time is called as instance variable.



                                                                                            Now understand the meaning of any run time memory allocation happen in C also through Malloc, Calloc, Realloc such:



                                                                                            struct p
                                                                                            {

                                                                                            }
                                                                                            p *t1
                                                                                            t1=(p) malloc(sizeof(p))


                                                                                            So here also we are allocating run time memory allocation but here we call as instance so t1 is instance here we can not say t1 as object so Every object is the instance of Class but every Instance is not Object.







                                                                                            share|improve this answer














                                                                                            share|improve this answer



                                                                                            share|improve this answer








                                                                                            edited Sep 10 '14 at 11:34









                                                                                            Mardoz

                                                                                            1,5421924




                                                                                            1,5421924










                                                                                            answered Sep 10 '14 at 10:37









                                                                                            Vivek Kumar

                                                                                            652




                                                                                            652






















                                                                                                up vote
                                                                                                0
                                                                                                down vote













                                                                                                An object can be a class, say you have a class called basketball.



                                                                                                but you want to have multiple basketballs so in your code you create more than 1 basketball



                                                                                                say basketball1 and basketball2.
                                                                                                Then you run your application.
                                                                                                You now have 2 instances of the object basketball.






                                                                                                share|improve this answer





















                                                                                                • That would mean a Object is a Instance of a Class Constructor ?
                                                                                                  – streetparade
                                                                                                  May 21 '10 at 20:47










                                                                                                • think of the object like a blueprint. say we have a blueprint for the basketball, that is the class. when the basketball is created and made it now exists, so that would mean we have 1 instance of the object basketball. if we built another basketball from the object(blueprint). we now have 2 instances of the basketball. There is always just 1 object, but we can make many instances of that object.
                                                                                                  – Darxval
                                                                                                  May 21 '10 at 21:08















                                                                                                up vote
                                                                                                0
                                                                                                down vote













                                                                                                An object can be a class, say you have a class called basketball.



                                                                                                but you want to have multiple basketballs so in your code you create more than 1 basketball



                                                                                                say basketball1 and basketball2.
                                                                                                Then you run your application.
                                                                                                You now have 2 instances of the object basketball.






                                                                                                share|improve this answer





















                                                                                                • That would mean a Object is a Instance of a Class Constructor ?
                                                                                                  – streetparade
                                                                                                  May 21 '10 at 20:47










                                                                                                • think of the object like a blueprint. say we have a blueprint for the basketball, that is the class. when the basketball is created and made it now exists, so that would mean we have 1 instance of the object basketball. if we built another basketball from the object(blueprint). we now have 2 instances of the basketball. There is always just 1 object, but we can make many instances of that object.
                                                                                                  – Darxval
                                                                                                  May 21 '10 at 21:08













                                                                                                up vote
                                                                                                0
                                                                                                down vote










                                                                                                up vote
                                                                                                0
                                                                                                down vote









                                                                                                An object can be a class, say you have a class called basketball.



                                                                                                but you want to have multiple basketballs so in your code you create more than 1 basketball



                                                                                                say basketball1 and basketball2.
                                                                                                Then you run your application.
                                                                                                You now have 2 instances of the object basketball.






                                                                                                share|improve this answer












                                                                                                An object can be a class, say you have a class called basketball.



                                                                                                but you want to have multiple basketballs so in your code you create more than 1 basketball



                                                                                                say basketball1 and basketball2.
                                                                                                Then you run your application.
                                                                                                You now have 2 instances of the object basketball.







                                                                                                share|improve this answer












                                                                                                share|improve this answer



                                                                                                share|improve this answer










                                                                                                answered May 21 '10 at 20:42









                                                                                                Darxval

                                                                                                85811129




                                                                                                85811129












                                                                                                • That would mean a Object is a Instance of a Class Constructor ?
                                                                                                  – streetparade
                                                                                                  May 21 '10 at 20:47










                                                                                                • think of the object like a blueprint. say we have a blueprint for the basketball, that is the class. when the basketball is created and made it now exists, so that would mean we have 1 instance of the object basketball. if we built another basketball from the object(blueprint). we now have 2 instances of the basketball. There is always just 1 object, but we can make many instances of that object.
                                                                                                  – Darxval
                                                                                                  May 21 '10 at 21:08


















                                                                                                • That would mean a Object is a Instance of a Class Constructor ?
                                                                                                  – streetparade
                                                                                                  May 21 '10 at 20:47










                                                                                                • think of the object like a blueprint. say we have a blueprint for the basketball, that is the class. when the basketball is created and made it now exists, so that would mean we have 1 instance of the object basketball. if we built another basketball from the object(blueprint). we now have 2 instances of the basketball. There is always just 1 object, but we can make many instances of that object.
                                                                                                  – Darxval
                                                                                                  May 21 '10 at 21:08
















                                                                                                That would mean a Object is a Instance of a Class Constructor ?
                                                                                                – streetparade
                                                                                                May 21 '10 at 20:47




                                                                                                That would mean a Object is a Instance of a Class Constructor ?
                                                                                                – streetparade
                                                                                                May 21 '10 at 20:47












                                                                                                think of the object like a blueprint. say we have a blueprint for the basketball, that is the class. when the basketball is created and made it now exists, so that would mean we have 1 instance of the object basketball. if we built another basketball from the object(blueprint). we now have 2 instances of the basketball. There is always just 1 object, but we can make many instances of that object.
                                                                                                – Darxval
                                                                                                May 21 '10 at 21:08




                                                                                                think of the object like a blueprint. say we have a blueprint for the basketball, that is the class. when the basketball is created and made it now exists, so that would mean we have 1 instance of the object basketball. if we built another basketball from the object(blueprint). we now have 2 instances of the basketball. There is always just 1 object, but we can make many instances of that object.
                                                                                                – Darxval
                                                                                                May 21 '10 at 21:08










                                                                                                up vote
                                                                                                0
                                                                                                down vote













                                                                                                Class : A class is a blue print.
                                                                                                Object : It is the copy of the class.
                                                                                                Instance : Its a variable which is used to hold memory address of the object.



                                                                                                A very basic analytical example



                                                                                                Class House --> Blueprint of the house. But you can't live in the blue print. You need a physical House which is the instance of the class to live in. i.e., actual address of the object is instance. Instances represent objects.






                                                                                                share|improve this answer

























                                                                                                  up vote
                                                                                                  0
                                                                                                  down vote













                                                                                                  Class : A class is a blue print.
                                                                                                  Object : It is the copy of the class.
                                                                                                  Instance : Its a variable which is used to hold memory address of the object.



                                                                                                  A very basic analytical example



                                                                                                  Class House --> Blueprint of the house. But you can't live in the blue print. You need a physical House which is the instance of the class to live in. i.e., actual address of the object is instance. Instances represent objects.






                                                                                                  share|improve this answer























                                                                                                    up vote
                                                                                                    0
                                                                                                    down vote










                                                                                                    up vote
                                                                                                    0
                                                                                                    down vote









                                                                                                    Class : A class is a blue print.
                                                                                                    Object : It is the copy of the class.
                                                                                                    Instance : Its a variable which is used to hold memory address of the object.



                                                                                                    A very basic analytical example



                                                                                                    Class House --> Blueprint of the house. But you can't live in the blue print. You need a physical House which is the instance of the class to live in. i.e., actual address of the object is instance. Instances represent objects.






                                                                                                    share|improve this answer












                                                                                                    Class : A class is a blue print.
                                                                                                    Object : It is the copy of the class.
                                                                                                    Instance : Its a variable which is used to hold memory address of the object.



                                                                                                    A very basic analytical example



                                                                                                    Class House --> Blueprint of the house. But you can't live in the blue print. You need a physical House which is the instance of the class to live in. i.e., actual address of the object is instance. Instances represent objects.







                                                                                                    share|improve this answer












                                                                                                    share|improve this answer



                                                                                                    share|improve this answer










                                                                                                    answered Jan 18 '17 at 19:41









                                                                                                    Sindhu

                                                                                                    146




                                                                                                    146






















                                                                                                        up vote
                                                                                                        -2
                                                                                                        down vote













                                                                                                        Object refers to class and instance refers to an object.In other words instance is a copy of an object with particular values in it.






                                                                                                        share|improve this answer

























                                                                                                          up vote
                                                                                                          -2
                                                                                                          down vote













                                                                                                          Object refers to class and instance refers to an object.In other words instance is a copy of an object with particular values in it.






                                                                                                          share|improve this answer























                                                                                                            up vote
                                                                                                            -2
                                                                                                            down vote










                                                                                                            up vote
                                                                                                            -2
                                                                                                            down vote









                                                                                                            Object refers to class and instance refers to an object.In other words instance is a copy of an object with particular values in it.






                                                                                                            share|improve this answer












                                                                                                            Object refers to class and instance refers to an object.In other words instance is a copy of an object with particular values in it.







                                                                                                            share|improve this answer












                                                                                                            share|improve this answer



                                                                                                            share|improve this answer










                                                                                                            answered Mar 20 '17 at 4:55









                                                                                                            Karamjit Singh Sehdev

                                                                                                            1




                                                                                                            1

















                                                                                                                protected by Stephen C Mar 26 '17 at 5:17



                                                                                                                Thank you for your interest in this question.
                                                                                                                Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).



                                                                                                                Would you like to answer one of these unanswered questions instead?



                                                                                                                Popular posts from this blog

                                                                                                                List item for chat from Array inside array React Native

                                                                                                                Thiostrepton

                                                                                                                Caerphilly