To know the type of a variable you can do it using the method . getClass(). getSimpleName() (you can also use . getName() ) and making a casting of (Object) for the variable of which you want to know its type.