0

I have known protected member is accessible only in its sub classes but some websites says that it's also accessible from same package non-subclasses.

Is it true?

java access modifier visibility chart

Ardent Coder
  • 3,777
  • 9
  • 27
  • 53
Abdullah Almasud
  • 159
  • 1
  • 11

1 Answers1

2

Yep. They did that to make all the access modifiers logically "nested" in privacy.

Judge Mental
  • 5,209
  • 17
  • 22