Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. what is the difference of “class instance” and “object”?

what is the difference of “class instance” and “object”?

Scheduled Pinned Locked Moved C / C++ / MFC
question
9 Posts 6 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • W Offline
    W Offline
    WangZHua
    wrote on last edited by
    #1

    what is the difference of “class instance” and “object”? thanks!

    D S C 3 Replies Last reply
    0
    • W WangZHua

      what is the difference of “class instance” and “object”? thanks!

      D Offline
      D Offline
      David Crow
      wrote on last edited by
      #2

      An object is an instance of a class.

      "Love people and use things, not love things and use people." - Unknown

      "The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch

      W 1 Reply Last reply
      0
      • W WangZHua

        what is the difference of “class instance” and “object”? thanks!

        S Offline
        S Offline
        Subrat 4708266
        wrote on last edited by
        #3

        Both are same if that object is of that class. It will be different if object is a structure object.BCZ in structure bydefault data members are public where in class it is private. In C structre---------->variable C++ it will be considered as object.

        W B 2 Replies Last reply
        0
        • W WangZHua

          what is the difference of “class instance” and “object”? thanks!

          C Offline
          C Offline
          CPallini
          wrote on last edited by
          #4

          WangZHua wrote:

          “class instance”

          ? :)

          If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
          This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
          [My articles]

          1 Reply Last reply
          0
          • D David Crow

            An object is an instance of a class.

            "Love people and use things, not love things and use people." - Unknown

            "The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch

            W Offline
            W Offline
            WangZHua
            wrote on last edited by
            #5

            then, why does rational rose has two concepts:“object” and “class instance”?

            N D 2 Replies Last reply
            0
            • S Subrat 4708266

              Both are same if that object is of that class. It will be different if object is a structure object.BCZ in structure bydefault data members are public where in class it is private. In C structre---------->variable C++ it will be considered as object.

              W Offline
              W Offline
              WangZHua
              wrote on last edited by
              #6

              all right,but,i think it is not perfect. i think,object is the description of class,instance is the dynamic concept. the method of object is description of class 's behaviour. the method of instance is description of module ‘s behaviour. is not it?

              1 Reply Last reply
              0
              • W WangZHua

                then, why does rational rose has two concepts:“object” and “class instance”?

                N Offline
                N Offline
                Nemanja Trifunovic
                wrote on last edited by
                #7

                WangZHua wrote:

                why does rational rose has two concepts

                Rational Rose is one of the most irrational pieces of software I have ever tried.

                Programming Blog utf8-cpp

                1 Reply Last reply
                0
                • S Subrat 4708266

                  Both are same if that object is of that class. It will be different if object is a structure object.BCZ in structure bydefault data members are public where in class it is private. In C structre---------->variable C++ it will be considered as object.

                  B Offline
                  B Offline
                  Bram van Kampen
                  wrote on last edited by
                  #8

                  What language are you trying to disect. An object is a lump of data that can be managed by a single handle, by whatever means, either by knowing th precice interpretation of the object, or by knowing how to handle it from the 'outside', and accessing it because you know it's type. A Class is a CPP construct, it is a Prototype, or blueprint of a cpp object. an Instance (of a class or type) is an actual variable of the type, and as such, an object. All cpp instances are objects, Not every object is a CPP class instance. If you understand the underlying ideas, the distinction becomes trivial, and at the same time futile! :)

                  Bram van Kampen

                  1 Reply Last reply
                  0
                  • W WangZHua

                    then, why does rational rose has two concepts:“object” and “class instance”?

                    D Offline
                    D Offline
                    David Crow
                    wrote on last edited by
                    #9

                    I can't speak of another's opinion. Perhaps you should ask them.

                    "Love people and use things, not love things and use people." - Unknown

                    "The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch

                    1 Reply Last reply
                    0
                    Reply
                    • Reply as topic
                    Log in to reply
                    • Oldest to Newest
                    • Newest to Oldest
                    • Most Votes


                    • Login

                    • Don't have an account? Register

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • World
                    • Users
                    • Groups