Set - 5

Question 31 :

What must a class do to implement an interface?

Answer :

It must provide all of the methods in the interface and identify the interface in its implements clause.


Question 32 :

What method is invoked to cause an object to begin executing as a separate thread?

Answer :

The start() method of the Thread class is invoked to cause an object to begin executing as a separate thread.


Question 33 :

Name two subclasses of the TextComponent class.

Answer :

TextField and TextArea


Question 34 :

What is the advantage of the event-delegation model over the earlier event-inheritance model?

Answer :

The event-delegation model has two advantages over the event-inheritance model. First, it enables event handling to be handled by objects other than the ones that generate the events (or their containers). This allows a clean separation between a component's design and its use. The other advantage of the event-delegation model is that it performs much better in applications where many events are generated. This performance improvement is due to the fact that the event-delegation model does not have to repeatedly process unhandled events, as is the case of the event-inheritance model.


Question 35 :

Which containers may have a MenuBar?

Answer :

Frame