Something
public java v1 · immutablepublic class TempMonitor { float currentTemp; public void setTemp(float newTemp) { currentTemp = newTemp; }}public class MyTempMonitor extends TempMonitor { public void setTemp(float newTemp, MyLoggerClass logger) { logger.log(currentTemp, newTemp); // Do something external with the temps setTemp(newTemp) // Call the original method to set the temp }}