⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 currentconditionsdisplay.java

📁 Head first design pattern这本经典书的 源码
💻 JAVA
字号:
package headfirst.observer.weather;	public class CurrentConditionsDisplay implements Observer, DisplayElement {	private float temperature;	private float humidity;	private Subject weatherData;		public CurrentConditionsDisplay(Subject weatherData) {		this.weatherData = weatherData;		weatherData.registerObserver(this);	}		public void update(float temperature, float humidity, float pressure) {		this.temperature = temperature;		this.humidity = humidity;		display();	}		public void display() {		System.out.println("Current conditions: " + temperature 			+ "F degrees and " + humidity + "% humidity");	}}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -