syntax - Java - what is "@Override" used for? -


possible duplicate:
what's “@override” there in java?

i've never put "@override" before method until now. see code examples it, don't understand utility. i'd love explanation.

many thanks,

jdelage

first, can't annotate class @override. annotation indicates method declaration intended override method declaration in superclass.

you don't have annotate overriding methods but if use annotation , annotated method does not override superclass method, compiler generate error message.


Comments

Popular posts from this blog

android - Spacing between the stars of a rating bar? -

aspxgridview - Devexpress grid - header filter does not work if column is initially hidden -

c# - How to execute a particular part of code asynchronously in a class -