-
Can an unreachable object become reachable again
An unreachable object may become reachable again. This can happen when the object'sfinalize() method is invoked and the object performs an operation which causes it tobecome accessible to reachable objects.
-
What are three ways in which a thread can enter the waiting state
A thread can enter the waiting state by invoking its sleep() method, by blocking on I/O,by unsuccessfully attempting to acquire an object's lock, or by invoking an object's wait()method. It can also enter the waiting state by invoking its (deprecated) suspend() method.
-
What happens when you invoke a thread's interrupt method while it issleeping or waiting
When a task's interrupt() method is executed, the task enters the ready state. The nexttime the task enters the running state, an InterruptedException is thrown.
-
Java Copy Command
Write the Java version of MS DOS Copy Command
-
What method is invoked to cause an object to begin executing as a separate thread
The start() method of the Thread class is invoked to cause an object to begin executing asa separate thread.
-
-
-
-
Encapsulation and data abstraction in Java
Can somebody tell me what is the example of encapsulation , data abstraction & polymorphism?
-
-
What happens if an exception is not caught
An uncaught exception results in the uncaughtException() method of the thread'sThreadGroup beinginvoked, which eventually results in the termination of the program in which it is thrown.
-
How are this and super used
This is used to refer to the current object instance. super is used to refer to the variablesand methods of thesuperclass of the current object instance.
-
Can an object's finalize() method be invoked while it is reachable
An object's finalize() method cannot be invoked by the garbage collector while the objectis still reachable.However, an object's finalize() method may be invoked by other objects.
-
-
-
-
What is the ResourceBundle class
The ResourceBundle class is used to store locale-specific resources that can be loaded bya program totailor the program's appearance to the particular locale in which it is being run.
-
What are three ways in which a thread can enter the waiting state
A thread can enter the waiting state by invoking its sleep() method, by blocking on I/O,by unsuccessfullyattempting to acquire an object's lock, or by invoking an object's wait() method. It canalso enter thewaiting state by invoking its (deprecated) suspend() method.
-
What is the purpose of garbage collection
The purpose of garbage collection is to identify and discard objects that are no longerneeded by a programso that their resources may be reclaimed and reused.
-
Java is Architectural _____________
A) DependentB) NeutralC) IndependentD) None of the above
Java Interview Questions
Ans