Advertisement
Guest User

Untitled

a guest
Mar 21st, 2019
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.16 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 hwk5_taylen_schmaltz;
  7.  
  8. /**
  9.  *
  10.  * @author tayle_000
  11.  */
  12. public class Employee {
  13.  
  14.     private String fullName;
  15.     private String empDept;
  16.     private String location;
  17.     private DeptName aDept;
  18.  
  19.     public Employee(String last, String first, int dpt) {
  20.         fullName = last + first;
  21.         aDept = new DeptName(dpt);
  22.         empDept = aDept.getDepartment();
  23.         location = aDept.getLocation();
  24.  
  25.     }
  26.  
  27.     public Employee(String aName, int dpt) {
  28.         fullName = aName;
  29.         aDept = new DeptName(dpt);
  30.         empDept = aDept.getDepartment();
  31.         location = aDept.getLocation();
  32.     }
  33.  
  34.  
  35.  
  36.     public String getLocation() {
  37.         return location;
  38.     }
  39.  
  40.     public String getDept() {
  41.         return empDept;
  42.     }
  43.  
  44.     public String getName() {
  45.         return fullName;
  46.     }
  47.  
  48.     @Override
  49.     public String toString() {
  50.         return fullName + ", " + aDept.getDepartment() + ", " + getLocation();
  51.        
  52.     }
  53.  
  54.  
  55. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement