Protected members can be accessed from anywhere within the same package. That's why your second example compiles. Protected members can only be accessed by subclasses in different packages if they are their own method. That means an instance of Child can methodX2(), but only using itself (or other instances of Child) as the reference. Using a Parent reference is not allowed.