Class is a type. It provides the protection means security for the members in it. A class is like a blueprint. It defines the data and behavior of a type. It is the best example for Encapsulation.