typeof in Java 8 You can use the getClass() method to get the type of the object you are using: Object obj = null; obj = new ArrayList<String>(); System.out.println(obj.getClass()); ... April 7, 2022 0 Comments