No, we cannot override private methods in Java as if we declare any variable,method as private that variable or method will be visible for that class only. If you declare any method as private than they are bonded with class at compile time not in run time so we cant reference those method using any object. Anyway, you can not override public or static method in Java, if you create similar method with same return type and same method arguments in child class then it will hide the super class method.
No, we cannot override private methods in Java as if we declare any variable,method as private that variable or method will be visible for that class only. If you declare any method as private than they are bonded with class at compile time not in run time so we cant reference those method using any object. Anyway, you can not override public or static method in Java, if you create similar method with same return type and same method arguments in child class then it will hide the super class method.
No, we cannot override private methods in Java as if we declare any variable,method as private that variable or method will be visible for that class only. If you declare any method as private than they are bonded with class at compile time not in run time so we cant reference those method using any object. Anyway, you can not override public or static method in Java, if you create similar method with same return type and same method arguments in child class then it will hide the super class method.
No, we cannot override private methods in Java as if we declare any variable,method as private that variable or method will be visible for that class only. If you declare any method as private than they are bonded with class at compile time not in run time so we cant reference those method using any object. Anyway, you can not override public or static method in Java, if you create similar method with same return type and same method arguments in child class then it will hide the super class method.
Answer : No, we cannot override private methods in Java as if we declare any
variable ,method as private that variable or method will be visible for that class only and also if we declare any method as private than they are bonded with class at compile time not in run time so we cant reference those method using any object so we cannot override private method in Java.
Can you override private or static method in Java ?
As I said method overriding is a good topic to ask trick questions in
Java. Anyway, you can not override private or static method in Java, if you create similar method with same return type and same method arguments in child class then it will hide the super class method, this is known as method hiding. Similarly you cannot override private method in sub class because it's not accessible there, what you do is create another private method with same name in child class. See Can you override private method in Java or more details.