Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
- package com.spec;
- import java.util.ArrayList;
- import java.util.List;
- /**
- *
- * @author Admin
- */
- public class Employee {
- private String name;
- private String dept;
- private int salary;
- private List<Employee> subordinates;
- //
- public Employee(String name, String dept, int salary) {
- this.name = name;
- this.dept = dept;
- this.salary = salary;
- subordinates = new ArrayList<>();
- }
- //
- public void add(Employee s){
- subordinates.add(s);
- }
- //
- public String getName() {
- return name;
- }
- public void setName(String name) {
- this.name = name;
- }
- public String getDept() {
- return dept;
- }
- public void setDept(String dept) {
- this.dept = dept;
- }
- public int getSalary() {
- return salary;
- }
- public void setSalary(int salary) {
- this.salary = salary;
- }
- public List<Employee> getSubordinates() {
- return subordinates;
- }
- public void setSubordinates(List<Employee> subordinates) {
- this.subordinates = subordinates;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement