I work in Netbeans, and it keeps advising me to use an iterator rather than a for-in loop. Last time I encountered it was with this bit:
ArrayList<String> numString = new ArrayList<>();
ArrayList<Integer> nums = new ArrayList<>();
String allNums = "";
nums.add(1);
nums.add(2);
nums.add(9);
for(int num : nums) {
allNums += String.valueOf(num);
}
numString.add(allNums);
for(String num : numString) {
System.out.println(num);
}
Does it have to do with efficiency? Via my own logic, the example above it more efficent than importing a class.