当您有递归调用时,您需要返回递归调用的值.
public boolean isLargest(Node tmp, Node parent){ if(tmp.value > parent.value){ parent = parent.right; return tmp.isLargest(tmp, parent); } else if(parent.value == tmp.value){ System.out.println("test"); return true; } return false;