πŸ“Š C++
Q. Which of the following is the correct way to define a constructor with parameters in C++?
  • (A) MyClass(int x, int y) { }
  • (B) void MyClass(int x, int y) { }
  • (C) int MyClass(int x, int y) { }
  • (D) None of the above
πŸ’¬ Discuss
βœ… Correct Answer: (A) MyClass(int x, int y) { }

Explanation: The correct way to define a constructor with parameters is 'MyClass(int x, int y) { }'.

Explanation by: Priyanka Tomar
The correct way to define a constructor with parameters is 'MyClass(int x, int y) { }'.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
99
Total Visits
πŸ“½οΈ
1 y ago
Published
πŸŽ–οΈ
Priyanka Tomar
Publisher
πŸ“ˆ
96%
Success Rate