返回列表 發帖
本帖最後由 陳宥穎 於 2020-7-3 20:28 編輯
  1. import java.io.Console;
  2. public class Ch05
  3. {
  4.    public static void main(String arvg[])
  5.    {
  6.      String str1,str2;
  7.      Console c=System.console();
  8.      System.out.print("輸入字串一: ");
  9.      str1=c.readLine();
  10.      System.out.println("字串一: "+str1);
  11.      System.out.print("輸入字串二: ");
  12.      str2=c.readLine();
  13.      System.out.println("字串二: "+str2);
  14.    }


  15. }
複製代碼

TOP

  1. import java.io.Console;
  2. public class Ch05
  3. {
  4.    public static void main(String arvg[])
  5.    {
  6.      String str1,str2;
  7.      Console c=System.console();
  8.      System.out.print("輸入字串一: ");
  9.      str1=c.readLine("輸入字串1:");
  10.      str2=c.readLine("輸入字串2:");
  11.      System.out.println(str1);
  12.      System.out.print(str2);
  13.    }
  14. }
複製代碼

TOP

返回列表