What is @Override Annotation in Java Programming


@Override Annotation in Java Programming



Hello Guys! I'm 101Programmer, In this post, You going to see What is @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.


Post a Comment

0 Comments