For Each Loop
Traversing a String
String str = "Hello, World!";
char[] charArray = str.toCharArray();
for (char ch : charArray) {
System.out.println(ch);
}// Output:
H
e
l
l
o
,
W
o
r
l
d
!Explanation
Traversing an Array
Explanation
Last updated