标签:square 方法 直接 eth 实验报告 赋值 bsp load oid
返回值不一样 一个是int整形 一个是double类型
还有就是没有写输出语句直接用对方法赋值的方法进行计算
public class MethodOverload {
	public static void main(String[] args) {
		System.out.println("The square of integer 7 is"+square(7));
		System.out.println("\nThe square of double 7.5 is"+square(7.5));
	}
	
	public static int square(int x) {
		return x*x;
	}
	
	public static double square(double y) {
		return y*y;
	}
}
标签:square 方法 直接 eth 实验报告 赋值 bsp load oid
原文地址:https://www.cnblogs.com/0518liu/p/9787189.html