How to avoid declaring variable outside of enhanced for loop
I want to avoid using variable index outside of enhanced for loop as it is useless after the loop and pollutes the namespace but cannot find my way around it. Problem int index = 0; // I want to avoid using this variable outside the loop for (List<Integer> bucket : buckets) { for (int el… Read More How to avoid declaring variable outside of enhanced for loop