@Override Annotation in Java Programming
@Override Annotation is used when we override a method in the Sub-class. Generally, novice Developers overlook this feature as it is not mandatory to use this annotation while overriding the method in Java. Below I gave an example for this @Override Annotation.
Example:
In the above example, we are overriding a method displayMethod() in the child class. Even If we dont use the @Override Annotation, the program would still run fine without any error.
0 Comments