https://kotlinlang.org logo
#announcements
Title
# announcements
l

linear

03/21/2017, 9:00 PM
so… just discovered that ‘protected' also grants visibility to all classes in the same package. Been doing Java a long time and somehow never noticed O_O
v

vach

03/22/2017, 7:50 AM
i'm not following can you explain?
l

linear

03/22/2017, 10:11 PM
If you declare a class variable as "protected" in Java, another class that belongs to the same package can access it as if it was public (but all other classes that aren't in the same package need to extend that class to access it).