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 overrides the setDepartment method.
D) The Programmer class can call the setDepartment method of the Programmer class.
Correct Answer:
Verified
Q27: Which reserved word must be used to
Q35: Consider the following code snippet:
Public class Vehicle
{
)
Q36: If a subclass defines the same method
Q37: Consider the following code snippet:
Public class Vessel
{
Private
Q38: Consider the following class hierarchy:
Public class Vehicle
{
Private
Q40: Consider the following code snippet:
Public void deposit(double
Q41: Consider the following class hierarchy:
Public class Vehicle
{
Private
Q42: Consider the following code snippet:
Public abstract class
Q43: Consider the following code snippet:
Public class Motorcycle
Q77: Consider the following code snippet: Vehicle aVehicle
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