How to override a method in Java - 030

preview_player
Показать описание
In this lesson I'll show you how to override behavior for existing methods, how to stop another developer from overriding your method, and we'll look at some unintended consequences when you override a method in Java.

Concepts: Java, Programming, overriding methods, shadowing attributes, final classes

Social Links: Don't hesitate to contact me if you have any further questions.

Related Videos:

Free Java Course Online

If You Watch 1 Playlist About Java Classes Watch this One!

Media credits: All images are owned by DJ Spiess unless listed below

Рекомендации по теме
Комментарии
Автор

You explain things so easily, thank you for this video!!! So

jenandjuice
Автор

Once in an interview I was asked why use private or public(getters and setters), this video shows the answer.
I was can only answer when we need hide a private static field, we can initializing via constructor and only can get static value calling get methods, we can not access private static field via class name
Thank you for this video.

lewonlewonik
Автор

Whenever I have a question, you show up to solve it. Thank you!!!!😊😊😊😊😊😊

williambluish
Автор

Hablo español y entiendo bastante el ingles, pero no es lo mismo entenderlo en español; tenía subtitulos en español y me ayudo demasiado, muchas gracias!.

javiermeza
Автор

thank for the explenation veryy usefull

syariftube
Автор

Firstly, thanks for this video.
Then, it's not clear for me that for the following statement as "System.out.println(digitalClock.numberOfSeconds);", why the output is 24 instead of 42.
Does it means we can just override the method, not the variable?
Thanks!

shuowang
Автор

I realize these were done in 2015, but the intro volume is beyond annoying - if you're still doing videos, pls fix! My sound is adjusted for your voice, not for getting blasted in each video's opening splash screen...

imtanuki