public class Main /**时 代 J a v a 公 众 号**/
{
// test overloaded square methods
public static void main(String[] args)
{
System.out.printf("Square of integer 7 is %d%n", square(7));
System.out.printf("Square of double 7.5 is %f%n", square(7.5));
}
// square method with int argument
public static int square(int intValue)
{
System.out.printf("%nCalled square with int argument: %d%n",
intValue);
return intValue * intValue;
}
/**来自 时代Java公众号 - nowjava.com**/
// square method with double argument
public static double square(double doubleValue)
{
/**代码未完, 请加载全部代码(NowJava.com).**/
本文系作者在时代Java发表,未经许可,不得转载。如有侵权,请联系nowjava@qq.com删除。