Aryan PrajapatKnowledge Contributor
In Java, static as well as private method overriding is possible. Comment on the statement.
In Java, static as well as private method overriding is possible. Comment on the statement.
In Java, you could indeed override a private or static method. If you create a similar method in a child class with the same return type and method arguments, it will hide the super class method; this is known as method hiding. Similarly, you cannot override a private method in a subclass because it is not accessible from that.