public static void main(String[] args) {
int x1 = 10;
int x2 = 20;
int retValue1 = sumInt(x1 , x2);
System.out.println(x1 + "+" + x2 + "=" + retValue1);
long y1 = 10L;
long y2 = 20L;
long retValue2 = sumLong(y1 , y2);
System.out.println(y1 + "+" + y2 + "=" + retValue2);
double z1 = 10.0;
double z2 = 20.0;
double retValue3 = sumDouble(z1, z2);
System.out.println(z1 + "+" + z2 + "=" + retValue3);
}
public static int sumInt(int a ,
Java 方法重载
最新推荐文章于 2024-06-20 20:20:21 发布