I am having trouble displaying an array by index, I don\'t know why this is happening. Any help will be greatly appreciated. Here is a snippet of my code:
// cre
You have put in your enhanced for loop correctly, its only the items you are not picking properly. Using enhanced for loop loop allows you to pick items without using indexes.
Change your loop from
// for-each loop
for(String ss : tempsArray2){
// display ss
System.out.println(tempsArray2[0]);
}
to
// for-each loop
for(String ss : tempsArray2){
// display ss
System.out.println(ss);
}