返回列表 發帖
  1. import java.io.Console;
  2. public class Ch06
  3. {
  4.     public static void main(String args[])
  5.     {
  6.           String str1,str2;
  7.           Console c=System.console();

  8.           str1=c.readLine("輸入字串1: ");
  9.           str2=c.readLine("輸入字串2: ");[code]
  10. [code]import java.io.Console;
  11. public class Ch05
  12. {
  13.     public static void main(String args[])
  14.     {
  15.        String str1,str2;
  16.        Console c=System.console();
  17.        System.out.print("輸入字串一: ");
  18.        str1=c.readLine();
  19.         System.out.println("字串一: "+str1);
  20.         System.out.print("輸入字串二: ");
  21.         str2=c.readLine();
  22.         System.out.println("字串二: "+str2);
  23.     }
  24. }
複製代碼

TOP

返回列表