返回列表 發帖
  1. public class ch54
  2. {
  3.     public static void main(String args[])
  4.     {
  5.         String str="Hello Java!";
  6.         System.out.println("字串 "+str+" 的長度為: "+str.length()+"個字元");
  7.         System.out.print("依序為: ");
  8.         for(int i=0; i<str.length(); i++)
  9.             System.out.print(str.charAt(i)+" ");
  10.     }
  11. }
複製代碼

TOP

返回列表