import java.util.ArrayList; import java.util.List; public class WeatherBroadcastStation { public WeatherBroadcastStation() { } public void registerObserver(WeatherStation weatherStation) { } public void removeObserver(WeatherStation weatherStation) { } public void notifyObservers(String weatherData) { } } public class WeatherStation { private String name; public WeatherStation(String name) { this.name = name; } public void update(String weatherData) { System.out.println("Weather update for " + name + ": " + weatherData); } } public class WeatherDemo { public static void main(String[] args) { // Create WeatherBroadcastStation WeatherBroadcastStation weatherBroadcaster = new WeatherBroadcastStation(); // Create WeatherStations (observers) WeatherStation delhiStation = new WeatherStation("Delhi"); WeatherStation mumbaiStation = new WeatherStation("Mumbai"); // Register WeatherStations to WeatherBroadcastStation weatherBroadcaster.registerObserver(delhiStation); weatherBroadcaster.registerObserver(mumbaiStation); // Notify Weather Stations with some weather data weatherBroadcaster.notifyObservers("Sunny with a chance of rain"); // Output: // Weather update for Delhi: Sunny with a chance of rain // Weather update for Mumbai: Sunny with a chance of rain } }