Last updated on June 13th, 2020 at 08:35 pm
Object:In OOP we can call objects as variables where each object may have its own variables too to operate. Objects are variables of user defined data type or class type. They may represent any item of that the program has to handle. As each class has some functions, objects declared of a class type will also be associated with the functions of the class type. Considering the following example.
int a, b;
student s1, s2, s3;
When executing the above lines of codes, for each s1, s2, s3 we will have two integers a and b as s1, s2, s3 all are objects of the class student and still the data for each of them will stay safe. And also by using all these objects we can call the three functions of the class individually.
Thus the main thing about Class and Object that it reduces codes and secure data.