GeeksforGeeks » Interview Questions
Microsoft Interview Question for Software Engineer/Developer about Object Oriented
(4 posts)-
Given an Ellipse class can you derive a Circle class from it? What all methods would you include in the circle class and what all in ellipse? Design a class of curve from which Circle and Ellipse can be inherited.
-
we should not
behavior are different -
The major and minor axis of a circle is the same. The focus is 0;
-
The class which would inherited for both would be the class of cones i think,
because to make a circle a cone is cut horizontally and for ellipse a cone is cut at an angle.remember the question says class of curves might contain some other curves
So class should contain
1) height of cone
2) base radius of cone
Reply
You must log in to post.