Multiple choice

A constructor is defined as Sum(int a = 10, float b = 10.0, char d = 'k'). Which of the following is a not legal statement that uses the constructor?

  1. Sum(1,1.0,'h')

  2. Sum(1)

  3. Sum(1,1.0)

  4. Sum('p')

  5. Sum(1.0)

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

This is not a legal statement that uses the constructor because when it runs, it gives an incorrect answer.