遞歸是一個(gè)非常有用的知識點(diǎn)。寫點(diǎn)實(shí)例幫助自己記憶
創(chuàng)新互聯(lián)主營欽州網(wǎng)站建設(shè)的網(wǎng)絡(luò)公司,主營網(wǎng)站建設(shè)方案,app軟件開發(fā)公司,欽州h5小程序開發(fā)搭建,欽州網(wǎng)站營銷推廣歡迎欽州等地區(qū)企業(yè)咨詢中間有過程代碼
首先一個(gè)javapojo類
package com.qcf.po; import java.util.HashSet; import java.util.Set; public class Depart { private long id; private String name; private String destion; //用戶 Setusers=new HashSet (); //子類部門 Set departs=new HashSet (); //父類部門 private Depart depart; public long getId() { return id; } public void setId(long id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public Set getUsers() { return users; } public void setUsers(Set users) { this.users = users; } public Set getDeparts() { return departs; } public void setDeparts(Set departs) { this.departs = departs; } public Depart getDepart() { return depart; } public void setDepart(Depart depart) { this.depart = depart; } public String getDestion() { return destion; } public void setDestion(String destion) { this.destion = destion; } }