Question: package ex 1 employee; / * * * * @author athee * / public class Ex 1 Employee { private String name; private int idNumber;

package ex1employee;
/**
*
* @author athee
*/
public class Ex1Employee {
private String name;
private int idNumber;
private String department;
private String position;
public Ex1Employee(String name, int idNumber, String department, String position){
this.name = name;
this.idNumber = idNumber;
this.department = department;
this.position = position;
}
public Ex1Employee(String name, int idNumber){
this.name = name;
this.idNumber = idNumber;
this.department ="";
this.position ="";
}
public Ex1Employee(){
this.name ="";
this.idNumber =0;
this.department ="";
this.position ="";
}
public void setName(String name){
this.name = name;
}
public void setIdNumber(int idNumber){
this.idNumber = idNumber;
}
public void setDepartment(String department){
this.department = department;
}
public void setPosition(String position){
this.position = position;
}
public String getName(){
return name;
}
public int getIdNumber(){
return idNumber;
}
public String getDepartment(){
return department;
}
public String getPosition(){
return position;
}
}
package employeeclasstest;
/**
*
* @author athee
*/
public class EmployeeClassTest {
public static void main(String[] args){
Ex1Employee employee1= new Ex1Employee("Susan Meyers", 47099, "Accounting", "Vice President");
Ex1Employee employee2= new Ex1Employee("Mark Jones", 39119,"IT", "Programmer");
Ex1Employee employee3= new Ex1Employee("Joy Rogers", 81774, "Manufacturing", "Engineer");
System.out.println("Employee 1:");
System.out.println("Name: "+ employee1.getName());
System.out.println("ID Number: "+ employee1.getIdNumber());
System.out.println("Department: "+ employee1.getDepartment());
System.out.println("Position: "+ employee1.getPosition());
System.out.println("
Employee 2:");
System.out.println("Name: "+ employee2.getName());
System.out.println("ID Number: "+ employee2.getIdNumber());
System.out.println("Department: "+ employee2.getDepartment());
System.out.println("Position: "+ employee2.getPosition());
System.out.println("
Employee 3:");
System.out.println("Name: "+ employee3.getName());
System.out.println("ID Number: "+ employee3.getIdNumber());
System.out.println("Department: "+ employee3.getDepartment());
System.out.println("Position: "+ employee3.getPosition());
}
}
why are these codes are not working together

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 Programming Questions!