+ 2
I'm not understanding that how this code works
3 Respostas
+ 4
what exactly is not clear.You try to compare two objecta whether are the same.For this purpose you owerride method equal which specifies the features of object accoring to make a decision that the objects can be considered as the same.
+ 2
no problem, sololearn community can help you to understand.Override is anotation for method with specific behavior defined in your class.Generally,it is not possible to compare objects if you don't know internal implementation.Due to every class has method compare you should to overried by yours.
+ 1
thanks @highman I'm just a beginner in java. i don't understood 'this' keyword used in if condition. and also @override in beginning