我有一个ArrayList,我正在使用迭代器来运行它.我需要找出下一个类型的对象:
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...
}
Run Code Online (Sandbox Code Playgroud)
谢谢