String str = "Go ahead.";
char[] cArray = str.toCharArray();
System.out.println("Size = " + cArray.length);
for (char c : cArray){
System.out.println(c);
}
Run this code and note that the char[] cArray = str.toCharArray();
System.out.println("Size = " + cArray.length);
for (char c : cArray){
System.out.println(c);
}
No comments:
Post a Comment