import java.util.ArrayList;
import java.util.Vector;
publicclass Main {
publicstaticvoid main(String[] args) {
Object testObject = new Vector();
if (testObject instanceof Vector)
System.out.println("Object was an instance of the class java.util.Vector");
elseif (testObject instanceof ArrayList)
System.out.println("Object was an instance of the class java.util.ArrayList");
else
System.out.println("Object was an instance of the " + testObject.getClass());
}
}
//Object was an instance of the class java.util.Vector