Home java What does "@Override" mean before the announcement of the method?

What does “@Override” mean before the announcement of the method?

Author

Date

Category

What does “@Override” mean before the method announced?


Answer 1, Authority 100%

In fact, the @OVerride indicates that then we are going override the basic class method.
In this case, if the base class does not turn out to be a method with a similar signature, we will receive a compiler warning that although we were going to override something, it did not happen on the fact.

On this action, the annotation ends.

Thus, the abstract does not affect the very fact of redefining method – when the signatures coincides with the base class method, it will be overridden, regardless of the availability, or the absence of this annotation. Abstract serves only to control the success of the action when assembling the project.

In the absence of this annotation and not the coincidence of signatures (as a result of an error) with the method that we were going to override – the scary – a very difficult mistake, when you think it should be overridden, and on the fact you have a separate independent method that Most likely it is not fulfilled at all. At the same time, the compiler believes that from its point of view everything is in order – you want your own method in the heir class – there are no problems. And silent.


Answer 2, Authority 23%

Annotation @Override Before the ads of the method means that the method redefines the announcement of the method in the base class.

Programmers, Start Your Engines!

Why spend time searching for the correct question and then entering your answer when you can find it in a second? That's what CompuTicket is all about! Here you'll find thousands of questions and answers from hundreds of computer languages.

Recent questions