標題:
[模擬考] TQC+ 108
[打印本頁]
作者:
張健勳
時間:
2017-6-10 12:14
標題:
[模擬考] TQC+ 108
完成" TQC+ 108 "題目
作者:
王彥甯
時間:
2017-6-10 12:16
class JPA01 {
public static int add(int a, int b)
{
System.out.printf("Adding two integers: %d , %d\n",a,b);
return a+b;
}
public static double add(double a, double b)
{
System.out.printf("Adding two double: %f , %f\n",a,b);
return a+b;
}
public static String add(String a, String b)
{
System.out.printf("Adding two strings: %s , %s\n",a,b);
return a+b;
}
public static void main (String[] args) {
int i = add(2, 3);
double d = add(5.2, 4.3);
String s = add("I love ", "Java!!");
System.out.printf("%d %f %s %n", i, d, s);
}
}
複製代碼
作者:
張健勳
時間:
2017-6-10 12:20
public class JPA01{
public static void main (String[] args) {
int i = add(2, 3);
double d = add(5.2, 4.3);
String s = add("I love ", "Java!!");
System.out.printf("%d %f %s %n", i, d, s);
}
public static int add(int i,int j){
System.out.printf("Adding two integer:%d,%d \n",i,j);
return (i+j);
}
public static double add(double i,double j){
System.out.printf("Adding two doubles:%2.1f,%2.1f \n",i,j);
return (i+j);
}
public static String add(String i,String j){
System.out.printf("Adding two strings:%s,%s \n",i,j);
return (i+j);
}
}
複製代碼
歡迎光臨 種子論壇 | 高雄市資訊培育協會學員討論區 (http://seed.istak.org.tw/)
Powered by Discuz! 7.2