For example is this
for (String s : getStrings()) {
// do something
}
less efficient than this?
ArrayList<String> strings = getStrings();
for (String s : strings) {
// do something
}
Would getStrings()
get called every time, thus affecting performance?