A class is a template or blueprint that contains everything needed to build an object. In object-oriented programming, an object is composed of methods and variables that define what it can do and what information it stores.