Tell me what is a class?

Submitted by: Muhammad
Class defines a datatype, it's type definition of category of thing(s). But a class actually does not define the data, it just specifies the structure of data. To use them you need to create objects out of the class. Class can be considered as a blueprint of a building, you can not stay inside blueprint of building, you need to construct building(s) out of that plan. You can create any number of buildings from the blueprint, similarly you can create any number of objects from a class.
class Vehicle
{
public:
int numberOfTyres;
double engineCapacity;
void drive(){
// code to drive the car
}
};
Submitted by: Muhammad

Read Online C++ Programmer Job Interview Questions And Answers