Similar Posts

Subscribe
Notify of
5 Answers
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
VanLorry
1 year ago

The class is virtually the “construction plan” for the objects.

And it is called “class” (instead of simply “construction plan”) – in the sense of “grouping” or “classification” – because all objects of a class are similar.

Example: Class “Auto” –> is used to create objects “Polo”, “Porsche 911” and “Beetle”. All these objects are similar, have similar properties (as they were specified by “Auto”.

A class “dog” can create objects that have nothing to do with cars. The objects “Dobermann”, “Pinscher” and “Schäferhund” are different than cars. They are their own group/class.

Palladin007
1 year ago

The class defines how the object “views”.

The program knows on the basis of the class (or what is made of it) where the data in the RAM are to be written by the object and how they are to be written there and where the code of the methods is.

However, you can create an object without an (own) class, while Java uses “Object” as a class. It only brings you very little in most cases.

KurixYT
1 year ago

The class specifies which parameters are stored, which methods exist and how these are defined. Without this information, there can be no object – without defining a class, the object would be useless and “empty”.

LeBonyt
1 year ago

I have heard from an IT autist that there are no objects but only instances of objects.

Fragenwuerfel
1 year ago

Imagine it as a family. The class is the parent and the object the child. The object inherits from this class. But no child can exist without a parent. However, parents can exist as they were there first even without the existence of the child.