Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class OverloadedMethods{
- public static void main(String []args){
- System.out.println(doubleAvg(3,5,630));
- System.out.println(doubleAvg(43,67,98,434));
- System.out.println(doubleAvg(98,454,676,453,7676));
- }
- public static double doubleAvg(int a, int b, int c){
- double abc = a + b + c;
- return abc/3;
- }
- public static double doubleAvg(int a, int b, int c, int d){
- double abcd = a + b + c + d;
- return abcd/4;
- }
- public static double doubleAvg(int a , int b, int c, int d, int e){
- double abcde = a + b + c + d + e;
- return abcde/5;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement