public static void main(String[] args){
}
class JiSuan{
//这是一个计算类
public int maxNum(){
}
//定义重载,计算两个数相加
public int maxNum(int a, int b){
if(a > b){
System.out.println("最大值是:" + a);
}else{
System.out.println("最大值是:" + b);
}
return a + b;
}
//定义float类型重载,这个类似上面,请提问者自行书写
}
public class Calculate
{
public static int maxNum(int a,int b){
return a>b ? a : b;
}
public static int maxNum(double a,double b){
return a>b ? a : b;
}
public static int maxNum(double a,double b,double c){
double max = maxNum(a,b)
return max >c ? max : c;
}
}