Answered step by step
Verified Expert Solution
Link Copied!
Question
1 Approved Answer

package 1 cs 1 2 5 _ example; public class Employee I / total number of Employee objects created is stoxed in count private static

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 1to 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:
//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",
}

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image
Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Databases Demystified

Authors: Andrew Oppel

1st Edition

0072253649, 9780072253641

More Books

Students explore these related Databases questions