Sprawdź typ zmiennej Java za pomocą metody getSimplename

package javaapplication;

public class Employee {

    public static void main(String args[]) {

       
        Object[] mixedObjects = new Object[]{"Hello", true, 1, new StringBuilder("Hello there"), new Employee(), new String[10]};

        for (Object item : mixedObjects) {
            System.out.println(item.getClass().getSimpleName());
        }

    }
}
Deepak