I compared access modifiers in Java and C #. I wanted to find an alternative to C # protected internalin Java. But I noticed that the modifier protectedis different in both languages ββ( C # and Java ). protectedin Java is equivalent protected internalfor C # because a member accesses it in the same package.
protected internal
protected
I have two questions
Java #?
. Java () # .
# ( , .) Java?
. Java .
, , protected, . , , , -, . , ( ).
, , , . , , .
:
Java API Sun.com.
D:\>javac Demo.java Demo.java:1: error: **modifier** private not allowed here private class Test ^ 1 error