Java Reference
In-Depth Information
Answers to Review Questions
1.
They are all true.
2.
public void setColor(String c) and public String getColor().
3.
Only a is true.
4.
True. Beans are often serialized, either on their own or after being hooked to other
beans.
5.
True. According to the JavaBeans specification, bean classes must have a no-argument
constructor.
6.
True. This is done using the Java-Bean parameter in a manifest file. If you forget to do
this in the manifest file, your bean will not appear in the builder tool as an available
bean.
7.
Two methods must appear: public void addFootballListener() and removeFootballLis-
tener(), both with FootballListener parameters. The other recommended but optional
method is getFootballListeners(), which returns all registered FootballListener objects
as an array.
8.
False. A listener vetoes a change by throwing a PropertyVetoException.
9.
False. The step that makes a property a bound property is when the fireProperty-
Change() method is invoked in the corresponding set method.
10.
True. This is the recommended behavior of a vetoed change. Keep in mind that if you use
the VetoableChangeSupport class to handle constrained properties, it does this for you.
11.
True. A bean gets to determine exactly how many listeners it wants to register for an
event.
12.
java.util.EventObject.
13.
java.util.EventListener.
14.
TelevisionBeanInfo.
15.
java.beans.XMLEncoder and java.beans.XMLDecoder.
Search WWH ::




Custom Search