The equals
method is part of the base Object
class in Java and the only way to make benefit of it is to override it. To override it you need to stick to the same signature which will tell any libraries using equals
to invoke your method instead of the base one.
Your above code is doing an overloading which is a totally different method to the Java compiler.