我有一个通用树
public abstract class Tree<T extends Term, U extends Terms>{
protected T termA;
protected U termB;
protected Tree<T,U>[] childs;
protected Tree( final T termA, final U termB, final Tree<T,U>[] childs){
this.termA = termA;
this.termB = termB;
}
public T getTermA(){
return termA;
}
public U getTermB(){
return termB;
}
public Tree<T,U>[] getChilds(){
return childs;
}
}
public final class TreeImpl extends Tree<Boolean,String>{
public TreeImpl( final Boolean termA, final String termB,TreeImpl[] childs){
super( termA, termB, childs);
}
}
在这种情况下,TreeImpl.getChilds返回Tree []。我想知道隐藏方法是否为
public TreeImpl[] getChilds(){
return childs;
}
这是最好的办法吗?
由于