java - @Override on Implementation -


would put annotation in implementation class methods? serve purpose? if mistype or don't have it, compile error anyway.

i assume asking annotating methods defined in implemented interface, or abstract in super class. in case, correct typo in method signature result in compile error or without @override. however, think annotation still helpful explicitly mark method implementing interface. if interface ever changes, having @override annotations on implementing methods can pinpoint method signatures have changed , need updated.

more importantly, mklhmnn mentioned in answer, if method removed interface, @override annotation in implementing class cause compile error. without annotation, might not aware method had been removed interface, lead subtle bugs.


Comments

Popular posts from this blog

c++ - How do I get a multi line tooltip in MFC -

asp.net - In javascript how to find the height and width -

c# - DataTable to EnumerableRowCollection -