for each loop java with string code example
Example: for each loop string java
String s = "xyz"
for (char ch: s.toCharArray()) {
System.out.println(ch);
}
String s = "xyz"
for (char ch: s.toCharArray()) {
System.out.println(ch);
}