TA的每日心情 | 开心 2021-3-12 23:18 |
---|
签到天数: 2 天 [LV.1]初来乍到
|
java 程序设计初步, 苏州职业大学计算机与电子工程系 曾海 2004-9
ppt教学课件。
考考你(16)
Assume the the class AcLis implements the ActionListener interface. The code fragment below constructs a button ande gives it four action listeners. When the button is pressed, which action listener is the first to get its actionPerformed() method invoked?
1. Button btn = new Button("Hello");
2. AcLis a1 = new AcLis();
3. AcLis a2 = new AcLis();
4. AcLis a3 = new AcLis();
5. btn.addActionListener(a1);
6. btn.addActionListener(a2);
7. btn.addActionListener(a3);
8. btn.removeActionListener(a2);
9. btn.removeActionListener(a3);
10. btn.addActionListener(a3);
11. btn.addActionListener(a2);
a. a1 gets its actionPerformed() method invoked first.
b. a2 gets its actionPerformed() method invoked first.
c. a3 gets its actionPerformed() method invoked first.
d. It is impossible to know which listener will be first.
点击查看答案
function TempSave(ElementID)
{
CommentsPersistDiv.setAttribute("CommentContent",document.getElementById(ElementID).value);
CommentsPersistDiv.save("CommentXMLStore");
}
function Restore(ElementID)
{
CommentsPersistDiv.load("CommentXMLStore");
document.getElementById(ElementID).value=CommentsPersistDiv.getAttribute("CommentContent");
}
源码下载:http://file.javaxxz.com/2014/10/1/125949078.zip |
|