In the simplest terms in int i, int is class and i is an object of that class. From the int class we can create several objects(variables). The int class indicates what kind of data an object of its type can hold and what operations(adition, subtration, etc) can be performed on this data . Aclass is thus a description of number of similar objects. it specifies what data and what functions will be included in objects of that class.
Instead of standard class like int you can think of user defined class like employee from which object like , e1, e2, e3 can be created through a statement .
employee e1, e2, e3;
Instead of standard class like int you can think of user defined class like employee from which object like , e1, e2, e3 can be created through a statement .
employee e1, e2, e3;

0 comments:
Post a Comment