Java递归算法遍历部门代码示例-创新互联

递归是一个非常有用的知识点。写点实例帮助自己记忆

创新互联主营钦州网站建设的网络公司,主营网站建设方案,app软件开发公司,钦州h5小程序开发搭建,钦州网站营销推广欢迎钦州等地区企业咨询

中间有过程代码

首先一个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;
	//用户
	Set users=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;
	}
}

网页题目:Java递归算法遍历部门代码示例-创新互联
分享网址:http://hbruida.cn/article/cddsph.html