What is the npurpose of
finalization?
The purpose of
finalization is to give an unreachable object the opportunity to perform any
cleanup processing before the object is garbage collected.
an object be garbage collected while it is still reachable?
A reachable object cannot be garbage collected. Only unreachable objects may be garbage collected..
Which class is the
superclass of the MenuComponent class?
Object
What is the GregorianCalendar class?
The GregorianCalendar provides support for traditional
Western calendars.
What is the purpose of the Runtime class?
The purpose of the Runtime class is to provide access to the
Java runtime system.
- An object's finalize() method may only be invoked once by the garbage collector.
- The finally clause is used to provide the capability to execute code no matter whether or not an exception is thrown or caught.
- A program's main() method takes an argument of the String[] type.
- The Locale class is used to tailor program output to the conventions of a particulargeographic, political, or cultural region.
- Yes, a double value can be cast to a byte.
- A break statement results in the termination of the statement to which it applies (switch, for, do, or while). A continue statement is used to end the current loop iteration and return control to the loop statement.
- A Canvas object provides access to a Graphics object via its paint() method.
- The high-level thread states are ready, running, waiting, and dead.
- The read() method returns -1 when it has reached the end of a file.
- The elements of a BorderLayout are organized at the borders (North, South, East, and West) and the center of a container.
The wait(),notify(), and
notifyAll() methods are used to provide an efficient way for threads to wait
for a shared resource. When a thread executes an object's wait() method, it
enters the waiting state. It only enters the ready state after another thread
invokes the object's notify() or notifyAll() methods.
Can a Byte
object be cast to a double value?
No, an object cannot be cast to a primitive value.
No, an object cannot be cast to a primitive value.
- A static inner class does not have any object instances.
- String objects are constants. StringBuffer objects are not.
- The Dictionary class provides the capability to store key-value pairs.
What is the difference between a Window and a Frame?
The Frame class
extends Window to define a main application window that can have a menu bar.
What is an objects lock
and which objects have locks?
An object's lock is a
mechanism that is used by multiple threads to obtain synchronized access to the
object. A thread may execute a synchronized method of an object only after it
has acquired the object's lock. All objects and classes have locks. A class's
lock is acquired on the class's Class object.
What is the % operator?
It is referred to as the
modulo or remainder operator. It returns the remainder of dividing the first
operand by 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 the referenced
interface.
an object be garbage collected while it is still reachable?
A reachable object cannot be garbage collected. Only unreachable objects may be garbage collected..
No comments:
Post a Comment