Ah now I understand what he wanted to hear was probably that you can add another abstract class, say, AbstractFlatShapes
then check
if (object is instance of AbstractFlatShapes){
//call area
}else{
//call volume
}
to make myself clear
AbstractFlatShapes
extends Shape
i am quite sure he wanted to hear that. Just imagine there are 15 flat shapes, and you do else if
for each shape? to call the same function.