Solved

Consider the Following Code Snippet: Public Class Employee

Question 21

Multiple Choice

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 NOT correct?


A) The Programmer class can call the setDepartment method of the Employee class.
B) The Employee class can call the setProjectName method.
C) The Programmer class's setDepartment method overrides the Employee class's setDepartment method.
D) The Programmer class can call the setDepartment method of the Programmer class.

Correct Answer:

verifed

Verified

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions