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. ...
Yes, a lock can be acquired on a class. This lock is acquired on the class's Class object..
Latest Answer : As your might already know, any synchronisation needs an object (monitor) to acquire lock one. See below for the three different types on how to synchronise code.public class A{ // A monitor object of sycnhronising piece of code. private ...
The setLayout() method is used to specify a container's layout.
The List interface provides support for ordered collections of objects.
Latest Answer : The list interface extends Collection and declares the behaviour of a collection that stores a sequence of elements. Elements can be inserted or accessed by their position in the list, using a Zero-based index. Alist may contain duplicate elements. ...
The Vector class provides the capability to implement a growable array of objects
Latest Answer : A vector implements dynamic array, which can grow and shrink dynamically.It is similar to Arraylist with a difference that vector can be synchronized. it also contain some legacy methods. ...
A (non-local) inner class may be declared as public, protected, private, static, final, orabstract.
Latest Answer : An inner class is a full pledged member of the enclosing class (outer class), so it can be marked with any access modifier including abstract or final modifiers(neer both abstract and final together). But an inner class cannot contain any static members ...
The Iterator interface is used to step through the elements of a Collection.
Latest Answer : Iterator Interface is part of java.util package.It is used to retrive the elements in the collection object one by one.It has methods like hasNext(),next().the iterator interface is obtained by using iterator() on the collection object.and the basic diff ...
setBounds()
Latest Answer : component.setBounds(-,-,-,-); ...
When a task invokes its yield() method, it returns to the ready state. When a task invokesits sleep() method, it returns to the waiting state.
Latest Answer : yield method is mainly used to release the lock of resource and pull up in to steady state from wait pool. Sleep() will pull the thread to sleep for the given time. It will throws exception while trying to intrupt in b/w the sleep state ...
The EventObject class and the EventListener interface support event processing.
Latest Answer : Java.util.Event class ...