Class and object are basic building blocks in object-oriented programming languages. A class is written by a programmer in a defined structure to create an object (computer science) in an object oriented programming language. It defines a set of properties and methods that are common to all objects of one type. 