Java - Methods and Code Reusability
What will be the output when the following Java program is executed?
class Calculator {
int multiply(int a, int b) { return a * b; }
double multiply(double a, double b) { return a * b; }
}
public class Test {
public static void main(String[] args) {
Calculator calc = new Calculator();
System.out.println(calc.multiply(4, 5));
System.out.println(calc.multiply(3.0, 2));
}
}