//实例
public class Der {
public static void main(String[] args) {
heavy_load sum=new heavy_load();
int a= sum.caculate(5,4);
double b=sum.caculate(5,1.5);
System.out.println(a+"\t"+b);
}
}
class heavy_load{
public int caculate(int a,int b){
return a+b;
}
public double caculate(int a,double b)
{
return a+b;
}
}
java学习---重载
最新推荐文章于 2024-10-31 18:26:46 发布