Constructor
The constructor creates an object and has to set the values for the attributes for an object instance. It can also do other things such as call other functions or perform computations. A class can have multiple constructors too, and it decides which one to call based on how we pass data.
For the Book
class example, let's have two constructor functions: one that has parameters and one that doesn’t. The definition of the constructors and how to call them is shown below.
