Tag: Constructor overloading
-
Constructor and constructor overloading
What is constructor? A Java constructor is special method that is called when an object is instantiated. In other words, when you use the new keyword. The purpose of a Java constructor is to initializes the newly created object before it is used.At the time of calling constructor, memory for the object is allocated in the memory.(we use new keyword to…