+ 1
What is the main difference between classes and objects??
2 ответов
+ 2
the objects are created from the classes; in the classes you define the characteristics and attributes that the objects will have; the objects will have the characteristics of the type of class to which they belong. "A class is the mold to create objects."
ejp:
class User {
age = 10;
sex = male;
name = so-and-so;
}
User person1 = new User ();
This case created an object of the User class, therefore this object will now have the characteristics of its class: age, sex, name.
+ 1
thanks a lot dear friend Luis Felipe Av