If a class is named DemoClass, what names are allowed as constructor names in the class DemoClass?
3 Likes
The constructor can only have the name of the class in which it is defined. Thus, all the constructors of class DemoClass will be named DemoClass.
Answered By
2 Likes
Explain the statement, "you cannot invoke constructors as normal method calls".
Describe the importance of parameterised constructors.
Explain the concept of constructor overloading with an example.
What is the use of the keyword this?