Learn Java Programming - @Override Annotation Tutorial

preview_player
Показать описание
The @Override is an annotation, an annotation does not change the way your program works, but rather it flags the compiler to be on the lookup for a special condition. When you override a method in a subclass it is a good idea to include the @Override annotation on the line before the method signature. The @Override annotation flags the compiler that the following method is overriding a method in a superclass. If that method does not exist in the superclass, the compiler will generate an error. Discovering an error when overriding a method saves a ton of time, especially if the overloaded method has a small typo in the name. An even better reason for including the @Override is flag someone else who is looking at your code that the method is in fact a overridden method. Without the annotation, the only way to know would be to peck and hunt through the food chain of superclasses. I personally absolutely love it when I see the @Override in Java code. It tells me right off the bat that the programmer who wrote the class had the foresight and took the time to be thorough.
Рекомендации по теме
Комментарии
Автор

Over 5yrs later, this short tutorial is still relevant. Thanks for making it.

BobBeatski
Автор

Thank you!! Never really understood the importance of @Override until now. Very helpful tutorial.

Автор

thanks man...now i will never forget this....

AmanRaj-qktr
Автор

Learning Java. Beautiful explanation of @Override. Thank you

rayc
Автор

wow! well explained. i had a hard time til now. thank you!

xiongbenjamin
Автор

Finally understood @Override!! after dozen of another lessons!

mtref
Автор

this is by far the best explanation thank you very much sir

ayoubifadir
Автор

Thank you Mr. it is very useful for me(from India)

hrithiksece
Автор

Man, put a link to your website in the video's description.
Your content here is great.
Thanks.

johnbritolima
Автор

Thanks for making this. Your video is simple and clear to pickup the usage of annotations.

mickee
Автор

Wow, you're actually a really good teacher.

formulaintuition
Автор

Great! The definition of an annotation in your website was more than enough :)

Chrisymcmb
Автор

Thank you! I finally know what it does.

TankArgie
Автор

Thanks Dan! You're video was great.

antoniocalarez
Автор

Great video, I finally understand this concept thanks to you

chrissmit
Автор

You're doing great sir! I see you don't get many views, but don't quit. You're very complete and concise, which are the most important aspects of instructional videos. You should find a graphic design student to give your channel and website some flair. A catchy 4 second intro video would be nice.

Nova-Rift
Автор

Great explanation. The posts about @Override on stackoverflow do not do a good job explaining this annotation. I understood immediately following your presentation. Kudos.

biometal
Автор

Great tutorial but not why just use an IDE? It's way more time and effort efficient compared to just manually writing code in notepad and manually making directories and compiling in cmd etc.

ChristopherGray
Автор

Great tutorial, it would be nice to copy the code on a link. Your website is no longer active. Thanks again.

HammadKhanYT