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;
- import com.spec.Employee;
- import com.spec.SingleObject;
- /**
- *
- * @author Admin
- */
- public class Main {
- //
- public static void main(String[] args) {
- //SingleObject o = new SingleObject();
- SingleObject object = SingleObject.getInstance();
- object.showMessage();
- //
- SingleObject.getInstance().showMessage();
- // сотрудник
- Employee e = new Employee("Test1", "Dep1", 100);
- // подчиненные данного сотрудника
- Employee e1 = new Employee("Test2", "Dep1", 200);
- Employee e2 = new Employee("Test3", "Dep1", 300);
- //
- e.add(e1);
- e.add(e2);
- //
- System.out.println("Сотрудник e=" + e.getName());
- for(Employee eObject: e.getSubordinates()){
- System.out.println("eObject.name=" + eObject.getName());
- }
- }
- }
Add Comment
Please, Sign In to add comment