设计模式(观察者模式)
观察者模式=发布者+订阅者
Subject.java
public class WeatherStation{ public static void main(String[] args){ WeatherData weatherData = new WeatherData(); CurrentConditionsDisplay currentDisplay= new CurrentConditionsDisplay(weatherData); currentDisplay._setM(80,65,30.4f); currentDisplay.display();}}