How to make a line of ArrayDeque?

I have a structure ArrayDeque<Character>, and I want to translate it in place. If it were an array of chars I could do this:

char[] chars = { 'A', 'B', 'C', 'D', 'E', 'F' };
StringFromChars String = String.valueOf(chars); // "ABCDEF"


But if I do the same with ArrayDeque, it turns out garbage:
String(String.valueOf(pass_raw)) -> [A, B, C, D, E, F]

Okay, but I'm unable to translate this into an array of chars and be done with it the same thing? No, you can't:
pass_raw.toArray() return char[]and Object[]. In this case I get a place?
April 19th 20 at 12:30
1 answer
April 19th 20 at 12:32
Solution
StringBuilder str = "";
for (char c : arrayDeque) {
str.append(c);
}

Find more questions by tags Java