Answer the question
In order to leave comments, you need to log in
How to make a string from ArrayDeque?
I have a struct ArrayDeque<Character>
and I want to convert it to a string. If it were an array of chars, I could do this:
char[] chars = { 'A', 'B', 'C', 'D', 'E', 'F' };
String stringFromChars = String.valueOf(chars); // "ABCDEF"
String(String.valueOf(pass_raw))
-> [A, B, C, D, E, F] pass_raw.toArray()
returns not char[]
, but Object[]
. How in this case to me to receive a line?
Answer the question
In order to leave comments, you need to log in
StringBuilder str = "";
for (char c : arrayDeque) {
str.append(c);
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question