Extending classes using Builder pattern
问题 I am trying to extend a class a, into aX. So, I also extend aBuilder. However, while I am able to create an object of class a using : aBuilder f = new aBuilder(); f.bi = i; f.bs = s; a atry = f.withI(i).withS(s).build(); The same doesn't work for aX. When I try to do this : aXBuilder fb = new aXBuilder(); aX aXtry = fb.withI(i).withS(s).withB(b).build(); I get an error (The method withB(Boolean) is undefined for the type a.aBuilder). Should I instead rewrite all the stuff for aX, instead of