In C++, the class forms the basis for Object oriented programming. The class is used to define the nature of an object.

Classes are created using the keyword class. A class declaration defines new type that links data and code.This new type is then used to create objects of that particular class.
Thus class is a logical abstraction, but an object has physical existence.
A class declaration is similar to a structure declaration syntactically.

Syntax of class

class class-name{
 access specifier:
     data members and member functions;
 access specifier:
     data members and member functions;

The object list is optional. If present, that would be declared as object of that class.
Access specifiers can be:

  1. Private
  2. Public
  3. Protected

By default, the access specifier is set to private. So if no access specifier is declared it would automatically assign private to it.