+ 2

Is writing "@Override" is must?

29th Jul 2018, 11:11 AM
Muntaha Islam
Muntaha Islam - avatar
6 ответов
+ 4
Do not confuse concepts, this annotation does not actually override, but monitors compliance with this condition. For example, you can write equals() without @Override, but if you make mistake, you will be never notificated about this
29th Jul 2018, 11:24 AM
Mishin870
Mishin870 - avatar
+ 2
yes it is compulsory to override the equals method of object class to use in our class with override notation
29th Jul 2018, 11:18 AM
Pragati Mahajan
Pragati Mahajan - avatar
+ 2
Yes, this is good practice. This annotation will prevent possible errors if you suddenly forget something. It is also added by all modern IDEs automatically when inheriting or implementing
29th Jul 2018, 11:18 AM
Mishin870
Mishin870 - avatar
+ 2
Thanks Mishin870 & Prgti
29th Jul 2018, 11:26 AM
Muntaha Islam
Muntaha Islam - avatar
+ 2
hmmmm........
29th Jul 2018, 11:28 AM
Pragati Mahajan
Pragati Mahajan - avatar
+ 1
So is it a good practice (according to Mishin870 ) or compulsory (according to Prgti ) ?
29th Jul 2018, 11:23 AM
Muntaha Islam
Muntaha Islam - avatar