- Java.util - WeakHashMap
- Java.util - Vector
- Java.util - UUID
- Java.util - TreeSet
- Java.util - TreeMap
- Java.util - TimeZone
- Java.util - TimerTask
- Java.util - Timer
- Java.util - StringTokenizer
- Java.util - Stack
- Java.util - SimpleTimeZone
- Java.util - ServiceLoader
- Java.util - Scanner
- Java.util - ResourceBundle.Control
- Java.util - ResourceBundle
- Java.util - Random
- Java.util - PropertyResourceBundle
- Java.util - PropertyPermission
- Java.util - Properties
- Java.util - PriorityQueue
- Java.util - Observable
- Java.util - Locale
- Java.util - ListResourceBundle
- Java.util - LinkedList
- Java.util - LinkedHashSet
- Java.util - LinkedHashMap
- Java.util - IdentityHashMap
- Java.util - Hashtable
- Java.util - HashSet
- Java.util - HashMap
- Java.util - GregorianCalendar
- Java.util - Formatter
- Java.util - EnumSet
- Java.util - EnumMap
- Java.util - Dictionary
- Java.util - Date
- Java.util - Currency
- Java.util - Collections
- Java.util - Calendar
- Java.util - BitSet
- Java.util - Arrays
- Java.util - ArrayList
- Java.util - ArrayDeque
- Java.util - Home
Java.util Package Extras
- Java.util - Discussion
- Java.util - Useful Resources
- Java.util - Enumerations
- Java.util - Exceptions
- Java.util - Interfaces
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
Java.util.Observable Class
Introduction
The java.util.Observable class represents an observable object, or "data" in the model-view paradigm.Following are the important points about Observable −
The class can be subclassed to represent an object that the apppcation wants to have observed.
An observable object can have one or more observers.
Class declaration
Following is the declaration for java.util.Observable class −
pubpc class Observable extends Object
Class constructors
Sr.No. | Constructor & Description |
---|---|
1 | Observable() This constructs an Observable with zero Observers. |
Class methods
Sr.No. | Method & Description |
---|---|
1 | This method adds an observer to the set of observers for this object, provided that it is not the same as some observer already in the set. |
2 | This method indicates that this object has no longer changed, or that it has already notified all of its observers of its most recent change, so that the hasChanged method will now return false. |
3 | This method returns the number of observers of this Observable object. |
4 | This method deletes an observer from the set of observers of this object. |
5 | This method clears the observer pst so that this object no longer has any observers. |
6 | This method tests if this object has changed. |
7 | If this object has changed, as indicated by the hasChanged method, then notify all of its observers and then call the clearChanged method to indicate that this object has no longer changed. |
8 | If this object has changed, as indicated by the hasChanged method, then notify all of its observers and then call the clearChanged method to indicate that this object has no longer changed. |
9 | This method returns marks this Observable object as having been changed; the hasChanged method will now return true. |
Methods inherited
This class inherits methods from the following classes −
java.util.Object