+ 2
C# Access modifiers
access modifiers in c# is somehow troubling me , so I made two table below showing whether class B can access elements (fields and methods)of class A (B doesn't inherit from A) , please read the tables and submit corrections if any . tables in the first two comments
3 ответов
+ 2
table 1 (A and B ) are in the same assembly
element. A is internal. A is public
modifier
private. no. no
protected. no. no
internal. yes. yes
protected
internal. yes? yes?
public. yes. yes
+ 2
Table 2 (A and B in different assembly)
element. A internal. A public
modifier
private. no no
protected. no. no
internal. no. yes?
protected
internal. no. no?
public. yes. yes