What is the difference between the default constructor, the no argument constructor, and other constructors like a 2 parameter constructor?
No argument constructor is the constructor of the class which takes no arguments/parameters into the function. If you don't write any constructor in the class, then the compiler creates a default no argument constructor for you. this constructor provided by the compiler is called a default constructor. difference is that we can write no argument constructor in class by ourself. where as compiler provided the default constructor. And we can also write constructors with more than one argument for example 2.
Get Answers For Free
Most questions answered within 1 hours.