Single Choice
Easy
QCan private methods be overridden in Java?
ID: #10342
Abstract class and method
138 views
Question Info
#10342Q ID
EasyDifficulty
Abstract class and methodTopic
Your Answer
Choose the Best Option
Click any option to instantly check if you're correct.
Correct Answer
Explanation
Private methods in Java can be overridden but only within the same class. This is because private methods are not visible outside the class and hence cannot be accessed from any other class. Private methods can be overridden by creating a new method with the same name and parameters in the same class. The new method will override the existing private method. However, private methods cannot be overridden in a subclass.
Continue Practice
Share
Share This Question
Challenge a friend or share with your study group.
More from This Topic