Is it possible to override a private member when subclassing in C # or Java?

good afternoon

I am learning C # and Java and asking a question regarding inheritance. Is it possible to override private members in a superclass (base class). In my opinion, this would be wrong, since the access modifier prevented member access.

Sorry ... hope the question is not stupid.

Regards Arian

+5
source share
7 answers

This is not a stupid question, but it gives a different concept to the hiding variable.

Java ( , , ). , , . Java , , . Static Binding - →

, , , , , , Static Binding. ( ) , . Static Binding, ( ), , . , Hidden , . , ( - ) .

+5

private , .

+4

, private, ( , ).

private , - private , .

+3

, .

, , , .

+2

, , PRIVATE FINAL, , , PUBLIC PROTECTED ( `t FINAL).

+2

, , Java #. C++.

, :)

+1

protected privated, childs

+1

All Articles