## Java program to implement method overloading based on the order of arguments

```
// Java program to implement method overloading based
// on the order of arguments
public class Main {
static float sum(int num1, int num2) {
int s = 0;
s = num1 + num2;
return s;
}
static float sum(int num1, float num2) {
float s = 0;
s = num1 + num2;
return s;
}
static float sum(float num1, int num2) {
float s = 0;
s = num1 + num2;
return s;
}
public static void main(String[] args) {
float result = 0;
result = sum(10, 20);
System.out.println("Sum : " + result);
result = sum(20, 20.56F);
System.out.println("Sum : " + result);
result = sum(30.45F, 34);
System.out.println("Sum : " + result);
}
}
```

## Output

```
Sum : 30.0
Sum : 40.559998
Sum : 64.45
```