java overload overload

test.day01 Package; 

public class overload2 {
public static void main (String [] args) {
System.out.println (SUM (30000000L, 30000000L));
}
// reload only the corresponding parameter passing
// the return value independent
SUM static Boolean public (byte A, B byte) {
System.out.println ( "two byte");
return A == B;
}

public static Boolean SUM (A Short, Short UI) {
System.out.println ( "two Short");
return == A UI;
}

public static Boolean SUM (A int, int B) {
System.out.println ( "two int");
return A == B;
}

public static Boolean SUM (double a, double b) {
System.out.println("两个double");
return a == b;
}

public static boolean sum(long a, long b) {
return a == b;
}
}

Guess you like

Origin www.cnblogs.com/cxycxycxy/p/11749902.html