+ 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

5th Oct 2017, 10:25 AM
Rabee Abbas
Rabee Abbas - avatar
2 Réponses
+ 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
5th Oct 2017, 10:32 AM
Rabee Abbas
Rabee Abbas - avatar
+ 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
5th Oct 2017, 10:41 AM
Rabee Abbas
Rabee Abbas - avatar