Similar to methods, a Java constructor may or may not have any parameters (arguments). If a constructor does not accept any parameters , it is known as a no-argument constructor. For example, private Constructor() { // body of the constructor }
Similar to methods, a Java constructor may or may not have any parameters (arguments). If a constructor does not accept any parameters , it is known as a no-argument constructor. For example, private Constructor() { // body of the constructor }