Objects that subclass the Observable class maintain a list of observers. When anObservable object is updated it invokes the update() method of each of its observers tonotify the observers that it has changed
Latest Answer : Observer observe only those class which are Observable. ...
With respect to multithreading, synchronization is the capability to control the access ofmultiple threads to shared resources. Without synchronization, it is possible for onethread to modify a shared
Latest Answer : Synchronization is the mechanism that ensures that only one thread is accessed the resources at a time. In a practical point of view assume that two threads are trying to update bank balance at the same time!!! How we can solve this issue the answer is sychronization. ...
Yes, a lock can be acquired on a class. This lock is acquired on the class's Class object..
Latest Answer : Aditya Pls write code and explain ...
When a thread terminates its processing, it enters the dead state.
Latest Answer : the thread enters the 'TERMINATED' state. at this point, the thread is not accessible ...
A thread enters the waiting state when it blocks on I/O.
Latest Answer : When a thread blocks on I/O, it enters to BLOCKED state. A thread enters WAITING state, while a thread calls wait(), and it will come back to READY state, while other threads call notify() or notifyAll(). The wait-notify model is called monitor pattern. ...
A thread is in the ready state after it has been created and started.
The purpose of finalization is to give an unreachable object the opportunity to performany cleanup processing before the object is garbage collected.
Latest Answer : Java provides a method called finalize( ) that you can define for your class. Here’s how it’s supposed to work. When the garbage collector is ready to release the storage used for your object, it will first call finalize( ), and only on the next garbage-collection ...
Latest Answer : Menu class is the immediate super class of MenuItem.MenuBar is the immediate super class of Menu.Frame is the immediate super class of MenuBar. ...
After a thread is started, via its start() method or that of the Thread class, the JVMinvokes the thread's run() method when the thread is initially executed.
Latest Answer : when its start() method is called ...
The start() method of the Thread class is invoked to cause an object to begin executing asa separate thread.