Yes, it’s almost the same. The protected modifier specifies that the member can only be accessed within its own package (as with package-private) and, in addition, by a subclass of its class in another package.
More Related Contents:
- What is the difference between public, protected, package-private and private in Java?
- Understanding java’s protected modifier
- Protected access modifier in Java
- Call protected method from a subclass of another instance of different packages
- Why can’t my subclass access a protected variable of its superclass, when it’s in a different package?
- What is reflection and why is it useful?
- What is null in Java?
- Difference between DTO, VO, POJO, JavaBeans?
- Java pass by reference
- When overriding a method, why can I increase access but not decrease it?
- Green Threads vs Non Green Threads
- What is the difference between a JavaBean and a POJO?
- What is a ‘SAM type’ in Java?
- What is the default access modifier in Java? [duplicate]
- Why does the “protected” modifier in Java allow access to other classes in same package?
- Pros and cons of package private classes in Java?
- What’s the difference between a Resource, URI, URL, Path and File in Java?
- Static block in Java not executed
- Why can a enum have a package-private constructor?
- What are fail-safe & fail-fast Iterators in Java
- What is the difference between “IS -A” relationship and “HAS-A” relationship in Java? [duplicate]
- Can non-static methods modify static variables
- Why we should not use protected static in java
- Is Java really passing objects by value? [duplicate]
- Modifier Keyword order in Java
- Difference between a deprecated and a legacy API?
- Default access modifier for a Java constructor
- Why can a class not be defined as protected?
- Why subclass in another package cannot access a protected method?
- Protected member access from different packages in java – a curiosity [duplicate]