I'm not understanding that how this code works | Sololearn: Learn to code for FREE!
Neuer Kurs! Jeder Programmierer sollte generative KI lernen!
Kostenlose Lektion ausprobieren
+ 2

I'm not understanding that how this code works

https://code.sololearn.com/c2sViapHotW0/?ref=app

10th Sep 2017, 12:45 PM
Shubham Rampurkar
Shubham Rampurkar - avatar
3 Antworten
+ 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.
10th Sep 2017, 12:54 PM
Highman
Highman - avatar
+ 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.
11th Sep 2017, 3:45 PM
Highman
Highman - avatar
+ 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
11th Sep 2017, 12:40 PM
Shubham Rampurkar
Shubham Rampurkar - avatar