typeof in Java 8

You can use the getClass() method to get the type of the object you are using: This will generate the following output: As you see it will show the type of the object which is referenced by the variable, which might not be the same as the type of the variable (Object in this case). For primitive types … Read more