posted 5 years ago
You can only access a protected member from a class outside the declaring class' package if you're extending the declaring class, and only through a reference of (a subtype of) the extending class. You may not access protected members through references of a supertype.
To access a from your main method, change the formal type of t to Test1.