Java experts, I sincerely appreciate any ideas!
I have an abstract class in a package with a protected method. I also have a subclass of this class in the same package. Now when I try to instantiate a subclass from a class outside the package and call the protected method on the instance of the subclass, Eclipse complains that the protected method is not displayed.
I thought that protected methods would be visible to all children β in or out of the package β until the classβs visibility limits it β in this case, both the parent and child classes are publicly available. What am I missing? Thanks in advance!
package X; public abstract class Transformation { protected OutputSet genOutputSet (List list) { .. } }
package X; public class LookupTransformation extends Transformation { }
package Y; import X.*; public class Test { public static void main(String[] args) { List<field> fld_list = new ArrayList(); .. LookupTransformation lkpCDC = new LookupTransformation(); OutputSet o = lkpCDC.genOutputSet(fld_list);
source share