Advertisement
sergAccount

Untitled

Feb 14th, 2021
614
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.83 KB | None | 0 0
  1. /*
  2.  * To change this license header, choose License Headers in Project Properties.
  3.  * To change this template file, choose Tools | Templates
  4.  * and open the template in the editor.
  5.  */
  6. package com.mycompany.ja12;
  7.  
  8. /**
  9.  *
  10.  * @author Admin
  11.  */
  12. public class Main2 {
  13.     public static void main(String[] args) {
  14.         // создать иерархию с несколькими уровнями (2-3 уровня)
  15.         Employee director = new Employee("name"); // 1
  16.         //directror.add(new Employee("name1"));
  17.         Employee man1 = new Employee("man1"); // 1
  18.         Employee man2 = new Employee("man1"); // 1
  19.         director.add(man1);
  20.         director.add(man2);
  21.         //
  22.         for(Employee e: director.getSubordinates()){
  23.             System.out.println("e.name=" + e.getName());
  24.         }
  25.        
  26.     }
  27. }
  28.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement