Question: package 1 c s 1 2 5 _ example; public class Employee I / total number of Employee objects created is stoxed in count private
package example;
public class Employee
I total number of Employee objects created is stoxed in count
private static int count :
private final String firstName:
private final string lastName;
Inftialize Employee, add to the count and
display the String indicating that constructor was called
public Employee String firstName, String lastName
this.firstName firstName;
this. lastName lastName;
count:
firstName, lastName, count:
s
public String getFirstName
return firstName;
public String getlastName
return lastName;
j
public static int getcount &
return count:
I end class Employee
package icsexample:
public class ICSExample
public static void mainString args &
System. out.printfEmplovees before instantiation: sdsn
:
Create two employees Bill Frown and Sue Black
Employee bill
Employee sue
System. out.printf snEmployees after instantiation:n :
Display the Employee count
System. out.printf via Employee.getCount : sdsn
end ICSExample
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
