Limited access

Upgrade to access all content for this subject

The following code sample uses a for-each loop to manipulate the values in an array of Strings:

String[] strings = {"hotel", "oscar", "whiskey", "delta", "yankee"};
String mystery = "";

for(String s : strings) {
   mystery += s.charAt(0);
}

System.out.print(mystery);
Select an assignment template