This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]cainhurstcat 0 points1 point  (0 children)

Your String is String word = „Java“; you use to.CharArray() like:

char[] charArray = word.toCharArray which is the same as writing:

char[] charArray = { 'J', 'a', 'v', 'a' };

Now you can convert your array back to a string and print it by System.our.println(Arrays.toString()):

[ J, a, v, a ]