Oracle Technology Network for Java Developers | Oracle Technology Network | Oracle toCharArray public char[] toCharArray() この文字列を新しい文字配列に変換します。 戻り値: 新しく割り当てられた文字配列。 長さはこの文字列の長さと同じで、内容はこの文字列によって表される文字シーケンスが格納されるように初期化されている使ってみた。 1 public class Char { 2 public static void main(String[] args) { 3 char[] ch = "ABCDE".toCharArray(); 4 for(int i=0;i<ch.length;i++){ 5 System.out.println(ch[i]); 6 } 7 } 8