2009年2月9日 星期一

第68題

Given the following six method names:
addListener
addMouseListener
setMouseListener
deleteMouseListener
removeMouseListener
registerMouseListener
How many of these method names follow JavaBean Listener naming rules?

A. 1
B. 2
C. 3
D. 4
E. 5
答案:B
參考:7-4 封裝
------------------------------------------------------------------
符合JavaBean Listener的命名規則
addListener
addMouseListener

1 則留言:

  1. JavaBean is a reusable software component that can be visually manipulated using the builder tool. The following are the JavaBean Listener naming rules:

    •Listener method names that are used to register a listener with an event source must use the prefix add followed by the listener type.
    •Listener method names that are used to remove a listener must use the prefix remove followed by the listener type.
    •The type of listener to be added or removed must be passed as the argument to the method.
    •Listener method names must end with the word “Listener”.

    回覆刪除