Class is a User Defined Data Type....it encapsulate both data and functions.Real time Example: Car is a class....under which we have different types, which is called a object interms of OOP.Software Ex: if i declare variable , say int a; .....here " int " is CLASS. and " a " is obeject of int class.
A class is a user-defined data type that encapsulates data and methods that can act upon the data together.
A class can also be defined as a classification/category of objects that have similar attributes and behaviour. For example, Automobile is a category of objects that have similar attributes, such as wheels, engine, doors, shape, color, cylinders etc., and behaviours, such as start, run, move, turn etc. Car is an instance of automobile which has different values for the attributes (4 wheels, one engine, 2 or 4 doors, 4/6/8 cylinders, etc), whereas, a semi-truck is another instance of automobile that has different values for the same attributes (18 wheels, one engine, two doors and so forth).
In C, we can use only inbuilt data types for program needs but from C++ we can create userdefined datatypes in form of classes. Classes wrap datamembers and member functions that operate on datamembers together.
Get invaluable Interview and Career Tips delivered directly to your inbox. Get your news alert set up today, Once you confirm your Email subscription, you will be able to download Job Inteview Questions Ebook . Please contact me if you there is any issue with the download.