189k views
5 votes
What type of a structure is the best way to iterate through the characters of a string?.

User Possum
by
6.4k points

1 Answer

8 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 Imran
by
6.1k points