Take two value and find out the area of square and rectangle by using overloding in java Programming.
Take two value and find out the area of square and rectangle by using overloding in java Programming.
Metodology: In
Overloding there are more than one methods .But every methods has different
perameters like for first methods take one perameters and for second
methods take two perameters . To find out the area of square and
rectangle first we have to create a class and then take two methods with
different perameters .To find out the area of Square we have to follow the
theory is Square = side*side.Then take the result in a veriable.To find out the
area of rectangle we have to follow the rules Rectangle =base*hight. And take
the result In a verisble. Then print those veriable.
Source code:
Output:
No comments