Skip to content

Latest commit

 

History

History
16 lines (10 loc) · 857 Bytes

File metadata and controls

16 lines (10 loc) · 857 Bytes

Method Overloading in Java with examples | FILED UNDER: OOPS CONCEPT

Method Overloading is a feature that allows a class to have more than one method having the same name, if their argument lists are different. It is similar to constructor overloading in Java, that allows a class to have more than one constructor having different argument lists.

let’s get back to the point, when I say argument list it means the parameters that a method has: For example the argument list of a method add(int a, int b) having two parameters is different from the argument list of the method add(int a, int b, int c) having three parameters.

QUESTION:-

Program to find area of Square, Rectangle and Circle using Method Overloading

Output: Area of the square: 37.21 sq units Area of the rectangle: 220.0 sq units Area of the circle: 116.8394 sq units