Can we Override static methods in java

preview_player
Показать описание
Q)Can we overload static methods in java?

The answer is "Yes". We can have two or more static methods with the same name but differences in input parameters.

Q)Can we Override static methods in java?

We can declare static methods with the same signature in the subclass
but it is not considered overriding as there won't be any run time polymorphism. Hence the answer is "No".

#interview #java #interviews #code #static #method #overload #override #programming #program
Рекомендации по теме