* @deprecated * This class and the {@link Observer} interface have been deprecated. * The event model supported by {@code Observer} and {@code Observable} * is quite limited, the order of notifications delivered by * {@code Observable} is unspecified, and state changes are not in * one-for-one correspondence with notifications. * For a richer event model, consider using the * {@link java.beans} package. For reliable and ordered * messaging among threads, consider using one of the concurrent data * structures in the {@link java.util.concurrent} package. * For reactive streams style programming, see the * {@link java.util.concurrent.Flow} API. */
There is a quote in there from Josh Bloch as part of JDK-4180466 (“Why is java.util.Observable class not serializable.”) dated February 1999: 引用自:Java’s Observer and Observable are Deprecated in JDK 9
This class is no longer under active development. It is largely unused in the JDK, and has, for the most part, been superseded by the 1.1 Beans/AWT event model. … Observable has fallen into disuse and is no longer under active development.
Start: I`am Mike, full name is "Random.Mike". Coordinates is (0,0). Start: I`am Alice, full name is "Random.Alice". Coordinates is (0,0). # Change1 :community.setCommunityName("UestcRun"); propertyChanged: I`am Mike, full name is "UestcRun.Mike". Coordinates is (0,0). propertyChanged: I`am Alice, full name is "UestcRun.Alice". Coordinates is (0,0). # Change2 :community.setDirection("up"); propertyChanged: I`am Mike, full name is "UestcRun.Mike". Coordinates is (0,1). propertyChanged: I`am Alice, full name is "UestcRun.Alice". Coordinates is (0,1). # Change3 :community.setCommunityName("UestcFly"); propertyChanged: I`am Mike, full name is "UestcFly.Mike". Coordinates is (0,1). propertyChanged: I`am Alice, full name is "UestcFly.Alice". Coordinates is (0,1). # Change4 :community.setDirection("left"); propertyChanged: I`am Mike, full name is "UestcFly.Mike". Coordinates is (-1,1). propertyChanged: I`am Alice, full name is "UestcFly.Alice". Coordinates is (-1,1).