Hi all,
I did some basic method overloading program, when I run the bellow program i got output as int long but expected is short long.. can Any one explain me
My code is :
public class MyClass {
public static void disp(Long n) {
System.out.println("Long ");
}
public static void disp(Short n) {
System.out.println("Short ");
}
public static void disp(int n) {
System.out.println("int ");
}
public static void main(String [] args) {
short y = 6;
long z = 7;
disp(y);
disp(z);
}
}
Thanks in advance