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 1cs125_example;
public class Employee
I/ total number of Employee objects created is stoxed in count
private static int count =0 :
private final String firstName:
private final string lastName;
// Inftialize Employee, add 1 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:
3
I /?? end class Employee
package ics125_example:
public class ICS125_Example_01{
public static void main(String[] args) &
System. out.printf("Emplovees 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",
}
1? end ICS125_Example
 package 1cs125_example; public class Employee I/ total number of Employee objects

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!