LearnFrenzy
Sign in Take a free test

Abstract Classes and Interfaces · Abstract Class MCQ · Question 11

Abstract class as a function parameter Answer, explanation & discussion

  • MCQ
  • Medium
  • 0 comments
  • Answer explained
  • Moderated community
Question 11 Back to Exercise

Which function declaration is valid if Shape is abstract?

  • A void f(Shape s);
  • B Shape f();
  • C void f(const Shape& s); Correct
  • D Shape arr[3];
Correct Answer: Option C

By-value parameters, return values and arrays would need Shape objects.

Discussion & Comments 0

Share your method, a shortcut, or ask about a step you didn't follow.

No comments yet. Be the first to share your solution!

Post your comment

Comments appear after a quick review by our team.

Search LearnFrenzy

Esc

Quick links