You can use == , but you get nothing, because that is exactly what Class.equals() does.
The class does not define the equals method, so it inherits from Object. You can read the source to see this.
I use equals where possible, since then I do not need to think about it. When I read the code (including my code), I still do not need to ask myself: == the same as equals or not for this class.
source share