choose one which one to prefer method overriding or method overloading ?
Most performance questions should actually be treated as; What is the simplest and clearest way to implement this code.
In this case, it doesn't have anything to do with performance. Just stick with the simplest and clearest option.
from academics point of view,given a case when we can solve a situation by both of the two concepts which one to prefer then ?
You would need to give an example, because I can't think of one.
to find the area of 3 geometrical shapes.
I would override the Shape.area() method, and in Java this would be simpler, and just as fast as three overloaded methods, depending on how you implemented it.
Say you did
Triangle t =
Circle c =
Square s =
double area = t.area() + c.area() + s.area();
This would be just as fast as
double area = t.area("String") + c.area(123L) + s.area(MyEnum.VALUE);
Assuming the arguments are just there to force different overloaded methods to be called, but as you can see this is not simple or clear why you would want to do this.