Sunday, 24 March 2013

What is adapter class?


What is adapter class?  
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() .

Blog Author: Vijay Kumar


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


What is meant by controls and what are different types of controls in AWT?  
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.

Blog Author: Vijay Kumar


What is the difference between choice and list?


What is the difference between choice and list?  
A Choice is displayed in a compact form that requires you to pull it down to see the list of available choices and only one item may be selected from a choice. A List may be displayed in such a way that several list items are visible and it supports the selection of one or more list items.

Blog Author: Vijay Kumar


What is the difference between set and list?


What is the difference between set and list?  
Set stores elements in an unordered way but does not contain duplicate elements, whereas list stores elements in an ordered way but may contain duplicate elements.

Blog Author: Vijay Kumar


What is an I/O filter?


What is an I/O filter?  
An I/O filter is an object that reads from one stream and writes to another, usually altering the data in some way as it is passed from one stream to another.

Blog Author: Vijay Kumar