The literal Object.class will always return the same link in the same classloader.
From section 15.8.2 of the JLS :
A class literal evaluates a Class object for a named type (or for void), as defined by the defining class loader for the class of the current instance.
Pay attention to a specific article ("the") in the above quote - there is only one Class object for any particular class, inside the same class loader.
So yes, you will get the same hash code because you will have two links to the same object.
source share