-
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.
-
If a class is declared without any access modifiers, where may the class be accessed
A class that is declared without any access modifiers is said to have package access. Thismeans that the class can only be accessed by other classes and interfaces that are definedwithin the same package.
-
What is the SimpleTimeZone class
The SimpleTimeZone class provides support for a Gregorian calendar.
-
What is the Map interface
The Map interface replaces the JDK 1.1 Dictionary class and is used associate keys withvalues.
-
For which statements does it make sense to use a label
The only statements for which it makes sense to use a label are those statements that canenclose a break or continue statement.
-
What is the purpose of the System class
The purpose of the System class is to provide access to system resources.
-
-
How are the elements of a CardLayout organized
The elements of a CardLayout are stacked, one on top of the other, like a deck of cards.
-
Is &&= a valid Java operator
No, it is not.
-
-
What is the relationship between clipping and repainting
When a window is repainted by the AWT painting thread, it sets the clipping regions tothe area of the window that requires repainting.
-
Is "abc" a primitive value
The String literal "abc" is not a primitive value. It is a String object.
-
What is the highest-level event class of the event-delegation model
The java.util.EventObject class is the highest-level class in the event-delegation classhierarchy.
-
What event results from the clicking of a button
The ActionEvent event is generated as the result of the clicking of a button.
-
How can a GUI component handle its own events
A component can handle its own events by implementing the required event-listenerinterface and adding itself as its own event listener.
-
What is the Collection interface
The Collection interface provides support for the implementation of a mathematical bag -an unordered collection of objects that may contain duplicates.
-
What is the purpose of the File class
The File class is used to create objects that provide access to the files and directories of alocal file system.
-
Can an exception be rethrown
Yes, an exception can be rethrown.
-
Which Math method is used to calculate the absolute value of a number
The abs() method is used to calculate absolute values.
-
Java Interview Questions
Ans