public class ForEach {
public ForEach() {
Object a = new Object();
Map.Entry arr[] = (Map.Entry[]) a;
for (int i = 0; i < arr.length; i++) {
System.out.println(arr[i]);
}
}
}
if i apply the 'replace for with for each' i get
for (Entry anArr : arr) {
System.out.println(anArr);
}
instead of for (Map.Entry anArr : arr) {