I have an ArrayList and I am using an iterator to run through it. I need to find out what type of object is next:
Iterator vehicleIterator = vehicleArrayList.iterator();
while(vehicleIterator.hasNext())
{
//How do I find the type of object in the arraylist at this point
// for example, is it a car, bus etc...
}
Thanks
1 Answer