Java Reference
In-Depth Information
Review Questions
1.
Which of the following statements is (are) true about JavaBeans? Select all that apply:
a. JavaBeans are software components.
b. JavaBeans are hooked together in a GUI builder tool.
c. You do not need to know how to write Java code to hook JavaBeans together.
d. JavaBeans are used widely in JavaServer Pages.
e. A JavaBean can be converted into an ActiveX component.
2.
If a bean has a read-write property named color of type String, what two methods
appear in the bean class?
3.
Suppose that a bean class declares the following two methods. Which of the following
statements is (are) true? Select all that apply.
public void setCompleted(boolean complete)
public boolean isCompleted()
a. The bean has a read-write property named completed.
b. The bean has a read-write property named Completed.
c. The bean has a write-only property named complete.
d. The property name for this bean depends on the name of the corresponding
field.
e. No property is determined from these two methods.
4.
True or False: A bean class should implement the java.io.Serializable interface.
5.
True or False: A bean class must contain a no-argument constructor.
6.
True or False: A bean in a JAR file must be denoted as a JavaBean in the manifest file
of the JAR.
7.
Suppose that you want a bean to be the source of an event named football. What
methods must appear in the bean class?
8.
True or False: A listener vetoes a constrained property change by returning false from
the vetoableChange() method.
9.
True or False: Adding a field of type PropertyChangeSupport to a bean class makes all
of the properties of the bean bound properties.
10.
True or False: If a constrained property is vetoed, a bean should go back and notify all
listeners that the bean is reverting back to the old value of the property.
Search WWH ::




Custom Search