Last iteration of enhanced for loop in java
Another alternative is to append the comma before you append i, just not on the first iteration. (Please don’t use “” + i, by the way – you don’t really want concatenation here, and StringBuilder has a perfectly good append(int) overload.) int[] array = {1, 2, 3…}; StringBuilder builder = new StringBuilder(); for (int i … Read more