binibiningtinamoran

Employee.java

Feb 2nd, 2021
823
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.56 KB | None | 0 0
  1. public class Employee {
  2.  
  3.     private Name name;
  4.     private Address address;
  5.     private String social;
  6.  
  7.     public Employee(Name name, Address address, String social) {
  8.         this.name = name;
  9.         this.address = address;
  10.         this.social = social;
  11.     }
  12.  
  13.     public Name getName() {
  14.         return name;
  15.     }
  16.  
  17.     public Address getAddress() {
  18.         return address;
  19.     }
  20.  
  21.     public String getSocial() {
  22.         return social;
  23.     }
  24.  
  25.     public void print() {
  26.         System.out.println(name + "\n" + address + "\n" + social);
  27.     }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment