generate functionTue, 24 Jan 2023

constructor of the class will be all the data except the employee number, which will be a generated number (the first employee to be employee number 1, the second employee number 2 and so on). and so on)

public Employee(String firstName, String surname, String address, String phoneNumber) { this.firstName = firstName; this.surname = surname; this.address = address; this.phoneNumber = phoneNumber; this.employeeNumber = employeeIdCounter++; }

Questions about programming?Chat with your personal AI assistant