...
Code Block | ||
---|---|---|
| ||
Character[] array = new Character[10];
for(int i=0;i<array.length;i++)
array[i] = 'x';
for(int i=0;i<array.length;i++)
System.out.print(array[i]); // prints 10 "x"s
|
Risk Assessment
Attempts to assign to the loop variable from within the enhanced for
loop (for-each idiom) are futile and may leave the class in a fragile, inconsistent state.
...