OK I read something, But I don't know why that compare return False? Henry explained, But I need to know more.
Since you're defining equals in the E class, you should only compare an E to an F if F is a subclass of E, which it's not.
abalfazl hossein wrote:I can define a method by the name abalfazl that can compare objects like this:
No you can't because it isn't a valid override nor overload.
Comment about your code:
abalfazl hossein wrote:Why equals is used for this purpose?
Search for it. This question has been answered millions of times.
abalfazl hossein wrote:equals works without override.How?Why for comparison two object needs to override
Arrays.equals is just a method. Nothing more nothing less. If you override the equals method then it can be used with polymorphism. Otherwise it can't.