1. The class AbstractButton is abstract. It is a sublcass of the JComponent clas
ID: 3801864 • Letter: 1
Question
1. The class AbstractButton is abstract. It is a sublcass of the JComponent class. It also implements two interfaces: ItemSelectable and SwingConstants. Fill in the blanks to complete the declaration of the class (case sensitive, check your spelling):
public _________________ class AbstractButton _____________ JComponent ______________ItemSelectable, SwingConstants
2. The ItemSelectable interface has method declaration for addItemListener, which returns void and has a parameter of type ItemListener. Which of the following code is correct for this declaration?
A. public addItemListener(ItemListener l);
B. public abstract void addItemListener(ItemListener l);
C. public void addItemListener(ItemListener l) { }
A. public addItemListener(ItemListener l);
B. public abstract void addItemListener(ItemListener l);
C. public void addItemListener(ItemListener l) { }
D. public abstract void addItemListener(String l);
Explanation / Answer
Question 1:
Answer:
public _______abstract__________ class AbstractButton _____extends________ JComponent ______implements________ItemSelectable, SwingConstants
Question 2
Answer:
B. public abstract void addItemListener(ItemListener l);
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.