Java Annotation - Example

Example

This example shows the use of the @Override annotation. It instructs the compiler to check parent classes for matching functions. In this case, an error is generated that the Cat's gettype function does not in fact override Animal's getType as desired, but instead declares a new function due to the name mismatch.

Read more about this topic:  Java Annotation

Famous quotes containing the word example:

    Our intellect is not the most subtle, the most powerful, the most appropriate, instrument for revealing the truth. It is life that, little by little, example by example, permits us to see that what is most important to our heart, or to our mind, is learned not by reasoning but through other agencies. Then it is that the intellect, observing their superiority, abdicates its control to them upon reasoned grounds and agrees to become their collaborator and lackey.
    Marcel Proust (1871–1922)