Call me stupid, but I only recently realized, that the access-level 'protected' has a different meaning in Java than in C#.
Java:
Visibility of the members of Alpha:
| Modifier | Alpha | Beta | AlphaSub | Gamma |
| public | Y | Y | Y | Y |
| protected | Y | Y | Y | N |
| no modifier* | Y | Y | N | N |
| private | Y | N | N | N |
(* also called package private)
C#:
Visibility of the members of Alpha:
| Modifier | Alpha | Beta | AlphaSub | Gamma |
| public | Y | Y | Y | Y |
| protected internal | Y | Y | Y | N |
| internal | Y | Y | N | N |
| protected | Y | N | Y | N |
| private * | Y | N | N | N |
(* private is the default access-level for members if nothing is specified)
No comments:
Post a Comment