You can send int while the funtion expects int. but the vice versa is true.
while coming to overloading ,
the compiler try to match the argument type and if it is not find a correct method , then try to widen the values and match (short to int or int to long).
<code>
public class OverLoadTest {
public static void main(
String[] args) {
OverLoadTest
test = new OverLoadTest();
short ding = 5;
test.checkOverLoad(ding);
}
/* public void checkOverLoad (int one)
{
System.out.println("CheckOverLoad for int called");
}*/
/* public void checkOverLoad (short two)
{
System.out.println("CheckOverLoad for Short called");
}*/
public void checkOverLoad (long three)
{
System.out.println("CheckOverLoad for Long called");
}
}
</code>