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:
Verified
Q30: Which of the following statements about superclasses
Q31: Which of the following indicates that a
Q36: Consider the following code snippet: public class
Q37: Consider the following class hierarchy: public class
Q39: Which of the following indicates that a
Q42: Consider the following code snippet: public class
Q43: Consider the following code snippet: public class
Q44: If a subclass uses the same method
Q45: Consider the following code snippet: public class
Q46: If a subclass defines the same method
Unlock this Answer For Free Now!
View this answer and more for free by performing one of the following actions
Scan the QR code to install the App and get 2 free unlocks
Unlock quizzes for free by uploading documents