After compile, it said "i has protected access in p1.A" in line 15. Why, B is subclass of A, and member i in A is protected. in my opinion, subclss can access protected member of baseclass. [ November 21, 2006: Message edited by: Barry Gaunt ]
you are correct, subclass can all the protected memebers of superclass, but only through inheritance and not through object reference, If package of subclass is different from superclass.
This should work,
public class B extends p1.A { public void process(A a) { i = i*2; } ....