1) Which reserved word must be used to call a method of a superclass? A) This B)
ID: 3683253 • Letter: 1
Question
1) Which reserved word must be used to call a method of a superclass?
A) This
B) Me
C) Super
D) Parent
2) How do you specify what the program should do when the user clicks a button?
A) Specify the actions to take in a class that implements the ButtonListener
B) Specify the actions to take in a class that implements the ButtonEvent interface .
C) Specify the actions to take in a class that implements the ActionListener
D) Specify the actions to take in a class that implements the EventListener
3) The ____ method should be called whenever you modify the shapes that the paintComponent method draws.
A) draw
B) paint
C) paintComponent
D) repaint
4) Consider the following code snippet:
public class Employee
{
. . .
public void setEmployeeDept(String deptNum)
{
. . .
}
}
public class Programmer extends Employee
{
. . .
public void setEmployeeDept(int deptNum)
{
. . .
}
}
Which of the following statements is correct?
A) The Programmer class overrides the setEmployeeDept
B) The Programmer class overloads the setEmployeeDept
C) The Employee class overrides the setEmployeeDept
D)The Employee class overloads the setEmployeeDept method.
5) If a subclass contains a method with the same name as a method in its superclass, but with different parameter types, the subclass method is said to ____ the method of the superclass.
A) implement
B) inherit
C) override
D) overload
6) A/an ____ belongs to a class whose methods describe the actions to be taken when a user clicks a user-interface graphical object.
A) Event listener
B) Event source
C) Action listener
D) Action method
Explanation / Answer
1)
Ans-c
Super
2)
Ans-c
Specify the actions to take in a class that implements the ActionListener
3)
Ans-d
Repaint
4)
Ans-a
The Programmer class overrides the setEmployeeDept
5)
Ans-c
override
6)
Ans-a
Event listener
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.