We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Day 5: Inheritance
Day 5: Inheritance
Sort by
recency
|
126 Discussions
|
Please Login in order to post a comment
If we dont use second parameter in Square, there is no need to overload parent's constructor:
But I presume such magic works only in JavaScript :)
wanted to know can't we override the prototype methods like earlier I was trying to create area method in square class too and from there was eventually calling super.area() so as to idirectly call reactangle's area method. Can someone please help me with any conceptual error which I am doing here?