346,189 views
20 votes
20 votes
What type of a structure is the best way to iterate through the characters of a string?.

User JackhammersForWeeks
by
1.9k points

1 Answer

14 votes
14 votes

Answer:Using the character iterator is probably the only correct way to iterate over characters, because Unicode requires more space than a Java char provides. A Java char contains 16 bit and can hold Unicode characters up U+FFFF but Unicode specifies characters up to U+10FFFF.

Step-by-step explanation:

User Orysia
by
3.1k points