16 lines
392 B
Java
16 lines
392 B
Java
package lab15_observer.ex2;
|
|
|
|
public class DigitalTimer implements TimerObserver {
|
|
private final MyTimer timer;
|
|
|
|
public DigitalTimer(MyTimer timer) {
|
|
this.timer = timer;
|
|
timer.registerObserver(this);
|
|
}
|
|
|
|
@Override
|
|
public void update(int hours, int minutes, int seconds) {
|
|
System.out.printf("Time: %02d:%02d:%02d%n", hours, minutes, seconds);
|
|
}
|
|
}
|