Advertisement
Guest User

Untitled

a guest
Mar 8th, 2017
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.64 KB | None | 0 0
  1. //геттеры и сеттеры
  2. public String getFullName() {
  3. return fullName;
  4. }
  5. public void setFullName(String fullName) {
  6. this.fullName = fullName;
  7. }
  8. public String getPosition() {
  9. return position;
  10. }
  11. public void setPosition(String position) {
  12. this.position = position;
  13. }
  14. public String getEmail() {
  15. return email;
  16. }
  17. public void setEmail(String email) {
  18. this.email = email;
  19. }
  20. public int getPhoneNumber() {
  21. return phoneNumber;
  22. }
  23. public void setPhoneNumber(int phoneNumber) {
  24. this.phoneNumber = phoneNumber;
  25. }
  26. public int getSalary() {
  27. return salary;
  28. }
  29. public void setSalary(int salary) {
  30. this.salary = salary;
  31. }
  32. public byte getAge() {
  33. return age;
  34. }
  35. public void setAge(byte age) {
  36. this.age = age;
  37. }
  38.  
  39. //параметризированный конструктор
  40. public Employee(String fullName, String position, String email, int phoneNumber, int salary, byte age) {
  41. this.fullName = fullName;
  42. this.position = position;
  43. this.email = email;
  44. this.phoneNumber = phoneNumber;
  45. this.salary = salary;
  46. this.age = age;
  47. }
  48.  
  49. public static void main(String[] args) {
  50. Employee [] mas = new Employee[5];
  51. mas[0] = new Employee("KozlovAA", "developer", "kozlovaa@mail.ru", 123456, 10000, (byte) 30);
  52. mas[1] = new Employee("IvanovAA", "engineer", "IvanovAA@mail.ru", 321654, 15000, (byte) 35);
  53. mas[2] = new Employee("PetrovEE", "manager", "PetrovEE@mail.ru", 234651, 8000, (byte) 40);
  54. mas[3] = new Employee("SidorovAA", "seller", "SidorovAA@mail.ru", 654321, 7000, (byte) 45);
  55. mas[4] = new Employee("AbramovichRO", "businessman", "AbramovichRO@mail.ru", 112233, 100000, (byte) 50);
  56. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement