Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //8.8 Employee.java
- //Employee class with references to other objects.
- public class Employee
- {
- private String firstName;
- private String lastName;
- private static int count = 0;
- public Employee1(String first, String last)
- {
- firstName=first;
- lastName=last;
- ++count;
- System.out.printf( "Employee constructor: %s %s; count = %d\n",
- firstName, lastName, count);
- }
- public String getFirstName()
- {
- return firstName;
- }
- public String getLastName()
- {
- return lastName;
- }
- public static int getCount()
- {
- return count;
- }
- } //end class Employee
Advertisement
Add Comment
Please, Sign In to add comment