-
What is the difference between the Reader/Writer class hierarchy and theInputStream/OutputStream class hierarchy
The Reader/Writer class hierarchy is character-oriented, and theInputStream/OutputStream class hierarchy is byte-oriented.
-
-
What value does read() return when it has reached the end of a file
The read() method returns -1 when it has reached the end of a file.
-
What value does readLine() return when it has reached the end of a file
The readLine() method returns null when it has reached the end of a file.
-
What method must be implemented by all threads
All tasks must implement the run() method, whether they are a subclass of Thread orimplement the Runnable interface.
-
Can an abstract class be final
An abstract class may not be declared as final.
-
What interface is extended by AWT event listeners
All AWT event listeners extend the java.util.EventListener interface.
-
What is a compilation unit
A compilation unit is a Java source code file.
-
What is a layout manager
A layout manager is an object that is used to organize components in a container.
-
When is an object subject to garbage collection
An object is subject to garbage collection when it becomes unreachable to the program inwhich it is used.
-
Which java.util classes and interfaces support event handling
The EventObject class and the EventListener interface support event processing.
-
To what value is a variable of the boolean type automatically initialized
The default value of the boolean type is false.
-
What interface must an object implement before it can be written to astream as an object
An object must implement the Serializable or Externalizable interface before it can bewritten to a stream as an object.
-
-
Name three Component subclasses that support painting
The Canvas, Frame, Panel, and Applet classes support painting.
-
Why do threads block on I/O
Threads block on i/o (that is enters the waiting state) so that other threads may executewhile the i/oOperation is performed.
-
Which containers use a border Layout as their default layout
The window, Frame and Dialog classes use a border layout as their default layout.
-
What is clipping
Clipping is the process of confining paint operations to a limited area or shape.
-
-
What is the GregorianCalendar class
The GregorianCalendar provides support for traditional Western calendars.
Java Interview Questions
Ans