Skip to main content

All Questions

-2 votes
1 answer
504 views

Protected variable not accessible within child class in Java

I have the following structure - App.java - package JohnParcellJavaBasics.AccessModifierDemo; import JohnParcellJavaBasics.AccessModifierDemo.*; public class App { public static void main(String[]...
Payel Senapati's user avatar
1 vote
0 answers
32 views

Why cannot I see third party protected members of parent? [duplicate]

I noticed strange behaviour of access modifier package protected_test.pack1; public class Source { protected int protectedInt= 1; } package protected_test.pack2; import protected_test....
gstackoverflow's user avatar
1 vote
4 answers
420 views

Expose constructor only to base class, possible?

public class Base<S> { public static Derived<S, T> Create<T>() { return new Derived<S, T>(); //if not public, I wont get it here. } } public class Derived&...
nawfal's user avatar
  • 72.3k