In an object-oriented language such as Java, an object contains variables that define its states and methods that defines its behaviors. In contrast to an object, a class is a blueprint from which an object is created. It reserves no memory space for date. An object is an instance of a class and has its ow date space. These 3 variables are needed to represent the exact time at a certain moment.
Constructor is similar to a method which is used to initialize a new object of the class.
Constructor is called automatically whenever a new class instance is created. We can use such constructors to assign values to the instance variables in class instances. It has the same name as the class but it cannot return a value, thus no return type is ever specified.