Web Development Interview Questions

What is an event and what are the models available for event handling?-

JAVA

Written by AgentElviseses Sunday, 08 April 2012 18:21

An event is an event object that describes a state of change in a source. In other words, event occurs when an action is generated, like pressing button, clicking mouse, selecting a list, etc. There are two types of models for handling events and they are: a) event-inheritance model and b) event-delegation model

 

What are the advantages of the model over the event-inheritance model?

JAVA

Written by AgentElviseses Sunday, 08 April 2012 18:21

- The event-delegation model has two advantages over the event-inheritance model. They are: a)It enables event handling by objects other than the ones that generate the events. This allows a clean separation between a component’s design and its use. b)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 be repeatedly process unhandled events as is the case of the event-inheritance.

What is source and listener?

JAVA

Written by AgentElviseses Sunday, 08 April 2012 18:21

- source : A source is an object that generates an event. This occurs when the internal state of that object changes in some way. listener : A listener is an object that is notified when an event occurs. It has two major requirements. First, it must have been registered with one or more sources to receive notifications about specific types of events. Second, it must implement methods to receive and process these notifications.

 

What is adapter class?

JAVA

Written by AgentElviseses Sunday, 08 April 2012 18:21

An adapter class provides an empty implementation of all methods in an event listener interface. Adapter classes are useful when you want to receive and process only some of the events that are handled by a particular event listener interface. You can define a new class to act listener by extending one of the adapter classes and implementing only those events in which you are interested. For example, the MouseMotionAdapter class has two methods, mouseDragged()and mouseMoved(). The signatures of these empty are exactly as defined in the MouseMotionListener interface. If you are interested in only mouse drag events, then you could simply extend MouseMotionAdapter and implement mouseDragged()

What is meant by controls and what are different types of controls in AWT?

JAVA

Written by AgentElviseses Sunday, 08 April 2012 18:21

Controls are components that allow a user to interact with your application and the AWT supports the following types of controls: Labels, Push Buttons, Check Boxes, Choice Lists, Lists, Scrollbars, Text Components. These controls are subclasses of Component.

 

Page 1 of 22

«StartPrev12345678910NextEnd»

Login Form (Can use your Gmail Acct)

Latest Comments

Copyright © 2017 Interview Questions, Tutorials, Certification Questions. All Rights Reserved.
Joomla! is Free Software released under the GNU/GPL License.