0

I know hat classes and objects are. But I can't figure out a good definition, that is simple (for programming beginners) and doesn't have a cycle.

Here is a definition that is simple, but has a ciclye:

Class: A class is a blueprint for objects.

Object: An object is an instanciated class.

Can you give a simple definition for programming beginners of class and object, that is not cyclic?

(Background of this question: I'm currently giving a tutorial and I wanted my students to give me defitionions of very basic terms. As I prepared my questions and answers, I noticed that it is quite difficult for me to define these two terms in a good way, although I can characterize differences in some programming languages without problems)

Martin Thoma
  • 124,992
  • 159
  • 614
  • 958

1 Answers1

0

I'm not sure you really can define one without the other, but I'm not sure they're as cyclical as you think.

Perhaps the other way around:

  • A class is a collection of attributes and behaviours that will describe something - insert example here.

  • An object is a particular instance of that something.

I don't think you can really define classes without reference to objects. However, you could do it the other way around:

  • An object is something that has both attributes (values that describe it), and methods (or operations - things that can be done to it).

  • A class is a way to abstract the description of an object, to say "all objects of this type have these important attributes and operations".

Don't know whether that helps or not...

KevinL
  • 170
  • 4