POR FAVOR ES URGENTE
sobrecarga simplemente es utilizar dos métodos de igual nombre pero con distintos parámetros i igual valor de retorno. Por ejemplo:
public class A
{
public int numero()
{
return 2;
}
public int numero(int x)
{
return 44 * x;
}
public int numero(String s, int j)
{
System.out.print(s);
return j;
}
public void numero(...){} // ERROR (diferente valor de retorno. )
}
public class A
{
public int numero()
{
return 2;
}
public int numero(int x)
{
return 44 * x;
}
public int numero(String s, int j)
{
System.out.print(s);
return j;
}
public void numero(...){} // ERROR (diferente valor de retorno. )
}
