Sobrecarga de Métodos

Sobrecarga de métodos.

package clases;
public class Calculadora {
    public static final double PI = 3.141592;
    
    public static int sumar(int a, int b){
        return a + b;
    }
    
    public static double sumar(double a, double b){
        return a + b;
    }
    
    //Sobrecarga de metodos 
    public int restar(int a, int b){
        return a - b;
    }
    
    public double restar(double a, double b){
        return a - b;
    }
}
//Clase calculadora 
Calculadora calcular = new Calculadora();
System.out.println(calcular.restar(50, 30));
System.out.println(calcular.restar(50.5, 30));