Can we override private and static methods in Java - Explaining with example.

preview_player
Показать описание
Can we override private and static methods in Java - Explaining with example.

Solution:
No, we cannot override private or static methods in Java.

Private methods in Java are not visible to any other class which limits their scope to the class in which they are declared.

we can't override static methods since method overriding relies on dynamic binding at runtime, but static methods are bonded at compile time with static binding. As a result, we are unable to override static methods

Chapters:
0:00 - Introduction to the video
0:14 - Explanation of overriding with example.
1:54 - Explaining why static methods can't be overridden.
3:11 - Explaining why private methods can't be overridden.

Next Steps :

---------------------------------------------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------------------------------------------
Must Watch Playlists

---------------------------------------------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------------------------------------------

#java
#staticmethods
#privatemethods
Рекомендации по теме