@Override is pseudo-code, which means rewriting (and of course not writing), but the following benefits are written:
1, can be used as a comment, easy to read;
2, the compiler can give you to verify @override the following method name is all in your parent class, if there is no error. For example, if you do not write @override, and your next method name is wrong, then your compiler can be compiled through, because the compiler thought this method is your subclass of the method of adding itself.
Example: When overriding the OnCreate of a parent class, adding a @override system in front of the method can help you check the correctness of the method.
@Override
public void OnCreate (Bundle savedinstancestate)
{.......}
This notation is correct if you write:
@Override
public void OnCreate (Bundle savedinstancestate)
{.......}
The compiler will report the following error: The method OnCreate (Bundle) of type HelloWorld must override or implement a Supertype method, to ensure that you correctly rewrite OnCreate methods ( Because the OnCreate should be OnCreate). And if you don't add @override, the compiler will not detect an error, but will think you have defined a new method for the subclass: OnCreate
The role of @override in Java