-
What is the Dictionary class
The Dictionary class provides the capability to store key-value pairs.
-
How are the elements of a BorderLayout organized
The elements of a BorderLayout are organized at the borders (North, South, East, andWest) and the centerof a container.
-
What is the % operator
It is referred to as the modulo or remainder operator. It returns the remainder of dividingthe first operandby the second operand.
-
When can an object reference be cast to an interface reference
An object reference be cast to an interface reference when the object implements thereferenced interface.
-
What is the difference between a Window and a Frame
The Frame class extends Window to define a main application window that can have amenu bar.
-
Which class is extended by all other classes
The Object class is extended by all other classes.
-
Can an object be garbage collected while it is still reachable
A reachable object cannot be garbage collected. Only unreachable objects may begarbage collected..
-
What is the difference between the Font and FontMetrics classes
The FontMetrics class is used to define implementation-specific properties, such asascent and descent, of aFont object.
-
How is rounding performed under integer division
The fractional part of the result is truncated. This is known as rounding toward zero.
-
What happens when a thread cannot acquire a lock on an object
If a thread attempts to execute a synchronized method or synchronized statement and isunable to acquirean object's lock, it enters the waiting state until the lock becomes available.
-
What classes of exceptions may be caught by a catch clause
A catch clause can catch any exception that may be assigned to the Throwable type. Thisincludes the Errorand Exception types.
-
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 orcontinue 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.
-
Name the eight primitive Java types
The eight primitive types are byte, char, short, int, long, float, double, and boolean.
-
Which class should you use to obtain design information about an object
The Class class is used to obtain information about an object's design.
Java Interview Questions
Ans