What Is A Class?
A class is a general term denoting classification and also has a new meaning in object-oriented methods. Within the OO context, a class is a specification of structure (instance variables), behavior (methods), and inheritance (parents, or recursive structure and behavior) for objects. As pointed out above, classes can also specify access permissions for clients and derived classes, visibility and member lookup resolution. This is a feature-based or intensional definition, emphasizing a class as a descriptor/constructor of objects (as opposed to a collection of objects, as with the more classical extensional view, which may begin the analysis process).
Ans : A class is a blueprint for objects: it defines a type of object according to the data the object can hold and the operations the object can perform. Classes are the fundamental units of design in object-oriented programming. A class is a pattern that defines a kind of object. It specifies a data structure for the object together with a set of operations for acting on the object’s data. A class is usually also a factory that creates objects. You can use a class to create one or more objects (instances of the class) when the program is run. Each instance carries its own data, such that you can change one instance and leave others unaffected. Classes specify capabilities for objects, and objects do the actual work. The Java String class, for example, defines an object type for character strings. A String instance holds a sequence of Unicode characters and provides a large number of methods for getting information about that string. Although there is just one String class, there can