Jump to content

how would you define the terms 'classes' and 'objects' ?

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
5 replies to this topic

#1
roniy

roniy

    Newbie

  • Members
  • PipPip
  • 16 posts
I tried to look for a good definition but couldn't find anything.
Can somebody give me a short and exact definition of these two terms ??


I know that
class= a user defined data type which consists data and functions
???

object= ??
I know what objects are and what they do but can't come up with a definition.

Thanks,
Roni.

#2
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
An object is an instance of a class. A class doesn't "occupy memory", an object does. Your definition of a class is pretty good, actually.
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

#3
roniy

roniy

    Newbie

  • Members
  • PipPip
  • 16 posts

WingedPanther said:

An object is an instance of a class. A class doesn't "occupy memory", an object does. Your definition of a class is pretty good, actually.

I see, thank you :)

#4
uberlax

uberlax

    Newbie

  • Members
  • PipPip
  • 12 posts
The way that I always think of the difference between the two is:

Object - exists in memory like a real object exists in space.
Class - is the blueprint for how to make an object.

#5
brownhead

brownhead

    Programmer

  • Members
  • PipPipPipPip
  • 173 posts
Er, I always though an object is just a generic term for a class like structure in a programming language. Then an instance is the way to describe an instance of the object in memory.

#6
dcs

dcs

    Programming God

  • Members
  • PipPipPipPipPipPipPip
  • 775 posts
[7] Classes and objects, C++ FAQ Lite

Also,

C99 said:

object
region of data storage in the execution environment, the contents of which can represent values