Multiple choice

If the first statement of a constructor has the form ________, then the constructor calls another constructor of the same class.

  1. static

  2. this(parameter list)

  3. this

  4. static(parameter list)

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

If the first statement of a constructor has the form this(parameter list), then the constructor calls another constructor of the same class. For example: class Emp {     int m;     double n;     public Emp(int x)     {             this(789.89,x);      } } Here, this(789.89,x) statement calls the constructor Emp(double,int)