In my code,
for(City city : country.getCities()){
// do some operations
}
Using country.getCities() is costly? Will JVM maintain the stacktrace for every call..?
List<City> cityList = country.getCities();
for(City city : cityList){
// do some operations
}
What is the best way to use?