Question-151. How will you invoke any external process in Java ?

Answer- By Runtime.getRuntime().exec(?) method.

Question-152. What an I/O filter ?

Answer- 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.

Question-153. What is transient keyword ?

Answer- If you define any data member as transient,it will not be serialized.

Question-154. What is Externalizable ?

Answer- Externalizable interface is used to write the state of an object into a byte stream in compressed format.It is not a marker interface.

Question-155. What is the difference between Serializalble and Externalizable interface ?

Answer- Serializable is a marker interface but Externalizable is not a marker interface.When you use Serializable interface, your class is serialized automatically by default. But you can override writeObject() and readObject() two methods to control more complex object serailization process. When you use Externalizable interface, you have a complete control over your class’s serialization process.

Question-156. Which containers use a FlowLayout as their default layout ?

Answer- The Panel and Applet classes use the FlowLayout as their default layout.

Question-157. What are peerless components ?

Answer- The peerless components are called light weight components.

Question-158. is the difference between a Scrollbar and a ScrollPane?

Answer- A Scrollbar is a Component, but not a Container. A ScrollPane is a Container. A ScrollPane handles its own events and performs its own scrolling.

Question-159. What is a lightweight component ?

Answer- Lightweight components are the one which doesn?t go with the native call to obtain the graphical units. They share their parent component graphical units to render them. For example, Swing components.

Question-160. What is a heavyweight component ?

Answer- For every paint call, there will be a native call to get the graphical units.For Example, AWT.