the thing I would like to know is how to write an enhanced for loop for an array based on the class of the object in the array. I understand how to do a for loop based on index number like if it's odd or even but I'm looking for based on class. Example:
Array[] Kind = new Array[3];
Kind[0] = new Fruit(xxx,yyy,zzz)
Kind[1] = new Veg(xxx,yyy,zzz)
Kind[2] = new Fruit(xxx,yyy,zzz)
Kind[3] = new Veg(xxx,yyy,zzz)
Fruit and Veg classes are created and extended from the Kind class. I need to write a FOR loop that out puts something for Fruit and something different for Veg.