返回列表 發帖
本帖最後由 t2364705 於 2013-6-29 17:19 編輯
  1. public class ch65
  2. {
  3.     public static void main(String args[])
  4.     {
  5.         String str="Hello Java";
  6.         System.out.println(str);
  7.         System.out.println("字串長度為:"+str.length()+"個字元");
  8.         System.out.print("依序為:");
  9.         for(int i=0; i<str.length(); i++)
  10.         {
  11.             System.out.print(str.charAt(i)+" ");
  12.         }
  13.     }
  14. }
複製代碼

TOP

返回列表