is protected accessible to other classes other than the sub classes? : <p>So I know this is a beginner question, but I got confused, because from what I understand is that protected is only accessible to sub-classes / classes that extend the super class .. <strong>but I'm working on a project and weirdly enough, I was able to access a protected instance variable from class A , in class B (class B does not extend class A).</strong>
Can someone please explain this?</p>
