Question: Consider the following code snippet: public class Employee { public void setDepartment ( String deptName ) { } } public class Programmer extends Employee {

Consider the following code snippet:
public class Employee
{
public void setDepartment(String deptName)
{
}
}
public class Programmer extends Employee
{
public void setProjectName(String projName)
{
}
public void setDepartment(String deptName)
{
}
}
Which of the following statements is correct?
The Employee class's
method overrides the
class's
method.
An object of type Employee can call the
method on itself.
An object of type
can call the
method of the Programmer class on
itself.
An object of type
can call the
method of the Employee class on
itself.
Consider the following code snippet: public class

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!