Wednesday, September 24, 2008

Java Interview Questions and Solution- java

1)What is an IO filter?
An IO 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.

2)What is the Set interface?
The Set interface provides methods for accessing the elements of a finite mathematical set. Sets do not allow duplicate elements.

3)How can you force garbage collection?
You can't force GC, but could request it by calling System.gc(). JVM does not guarantee that GC will be started immediately.

4)What is the purpose of the enableEvents() method?
The enableEvents() method is used to enable an event for a particular object. Normally, an event is enabled when a listener is added to an object for a particular event. The enableEvents() method is used by objects that handle events by overriding their event-dispatch methods.

5)What is the difference between the File and RandomAccessFile classes?
The File class encapsulates the files and directories of the local file system. The RandomAccessFile class provides the methods needed to directly access data contained in any part of a file.


No comments:

Post a Comment

Thanks to given comments.......

My Blog List