Consider the following class class ABC { int a; int b; public : constructor function }; We wish to define the constructor function using an initialization list. Which one of the following is the legal constructor function?
- ABC (int x, int y): a (x), b(y) { }
- ABC (int x, int y): b (x), a(x+y) { }
- ABC (int x, int y): a (x), b(a*y) { }
- All the above
Answer:
Option d: All the above
Explanation Here
0 Comments