
5.6 Class Objects and Methods
Line No. 16: declares a default constructor with nill arguments. However, it calls Set
methods to set initial values of 0.0 for a, b, r, t at Line No. 18. Note that these
Set methods are defined at Line Nos. 10–13.
Overloading of constructors means the same name but different signatures (number and
type of parameters). In the above example, we have overloaded the constructors as shown
below:
Line No. 16:
Polar() { ………………………….) Nil arguments. This type of construc-
tor is called NIL arguments constructor and also as default constructor.
Line No. 20: Polar2(double ad, double bd){…………………………………….}
2 arguments
Line No. ...