We can then create objects of this class using Rectangle rect = new Rectangle();. Constructors are used to create and initialise objects. Even if no constructor is defined by the programmer, Java provides a default constructor.
We can then create objects of this class using Rectangle rect = new Rectangle();. Constructors are used to create and initialise objects. Even if no constructor is defined by the programmer, Java provides a default constructor.