X803: Fundamentals 6

For the question below assume the following implementation of the Employee class

public static class Employee{

    public int ID;

    public int getID() {
        return ID;
    }

    public int getTimesCalled(){
        return timesCalled;
    }

    public void setID(int employeeID) {
        this.ID = employeeID;
    }

}// End Employee

The following code will be executed before the code you'll write. You will be able to reference e1 and e2 as variables in your code.

Employee e1 = new Employee();
Employee e2 = new Employee();
e1.setID(123);
e2.setID(456);
e1 = e2;

For this question, assign both IDs of e1 and e2 to equal 789. This code can be done with only one line of code

Your Answer:

Reset

Practice a different Java exercise

Feedback

Your feedback will appear here when you check your answer.