rahajengdwp

Untitled

Mar 6th, 2017
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. //8.8 Employee.java
  2. //Employee class with references to other objects.
  3.  
  4. public class Employee
  5. {
  6. private String firstName;
  7. private String lastName;
  8. private static int count = 0;
  9. public Employee1(String first, String last)
  10. {
  11. firstName=first;
  12. lastName=last;
  13. ++count;
  14. System.out.printf( "Employee constructor: %s %s; count = %d\n",
  15. firstName, lastName, count);
  16. }
  17. public String getFirstName()
  18. {
  19. return firstName;
  20. }
  21. public String getLastName()
  22. {
  23. return lastName;
  24. }
  25. public static int getCount()
  26. {
  27. return count;
  28. }
  29. } //end class Employee
Advertisement
Add Comment
Please, Sign In to add comment