关于Java的继承,以下哪项是正确的?
1) Private methods are final.
2) Protected members are accessible within a package and
inherited classes outside the package.
3) Protected methods are final.
4) We cannot override private methods.
(A) 1、2和4
(B)只有1和2
(C) 1、2和3
(D) 2、3和4答案: (A)
说明:参见https://www.geeksforgeeks.org/can-override-private-methods-java/和https://www.geeksforgeeks.org/comparison-of-inheritance-in-c-and-java/
这个问题的测验