getting variable types

does anyone know how to get variable types for each data from Object arr[]?thanks
[95 byte] By [McKayLeea] at [2007-11-27 0:47:46]
# 1

Class theConcreteType = arr[i];

Put it in a loop to get the type for each object in the array.

If you want the name of the class, use Class.getName().

If you want the abstract types (i.e., interfaces), or the other concrete classes in the class hierarchy (i.e., the superclasses), you can use various reflection methods on the Class objects.

paulcwa at 2007-7-11 23:16:22 > top of Java-index,Java Essentials,Java Programming...