// Checking whether an Integer is of primitive type or not Integer value = 10; boolean isPrimitive = value.getClass().isPrimitive(); // Returns false
// Checking whether a double is of primitive type or not double value = 3.14; boolean isPrimitive = Double.class.isPrimitive(); // Returns trueThis method is a part of the reflection package library in Java and can be accessed by importing the java.lang.reflect package.