+1 vote
in JAVA by
In Java, static as well as private method overriding is possible. Comment on the statement.

1 Answer

0 votes
by

The statement in the context is completely False. The static methods have no relevance with the objects, and these methods are of the class level. In the case of a child class, a static method with a method signature exactly like that of the parent class can exist without even throwing any compilation error.

The phenomenon mentioned here is popularly known as method hiding, and overriding is certainly not possible. Private method overriding is unimaginable because the visibility of the private method is restricted to the parent class only. As a result, only hiding can be facilitated and not overriding.

Related questions

0 votes
asked May 6, 2020 in C Sharp by SakshiSharma
0 votes
asked Jul 2, 2023 in JAVA by rajeshsharma
...