posted 22 years ago
While taking a mock exam, I ran into the following question:
Q: Which of the following are true:
One of the options was:
"A private method can not be overriden and made public."
The answer that was given in the exam was that this is a false statement. However, even though it's true that, when overriding methods, you can make them "more public," you can't override a private method, right? If you can't override a private method, you can't override it to make it public, right?
Just a quick addition to this question. If class B extends class A, which contains a private member C, is B considered to inherit B from A even though it doesn't have access to it?
Thanks,
Corey