/*
Big Ben clock
*/

public class Solution {
    public static volatile boolean isStopped = false;

    public static void main(String[] args) throws InterruptedException {
        Clock clock = new Clock("Лондон", 23, 59, 57);
        Thread.sleep(4000);
        isStopped = true;
        Thread.sleep(1000);
    }

    public static class Clock extends Thread {
        private String cityName;
        private int hours;
        private int minutes;
        private int seconds;

        public Clock(String cityName, int hours, int minutes, int seconds) {
            this.cityName = cityName;
            this.hours = hours;
            this.minutes = minutes;
            this.seconds = seconds;
            start();
        }

        public void run() {
            try {
                while (!isStopped) {
                    printTime();
                }
            } catch (InterruptedException e) {
            }
        }

        private void printTime() throws InterruptedException {
            //add your code here - добавь код тут
            Thread.sleep(1000);
            seconds++;


            if(seconds==60){seconds=0;minutes++;}
            if(minutes==60){minutes=0;hours++;}
            if(hours==24){hours=0;}


            if (hours==0&&minutes==0&&seconds==0) {
                System.out.println(String.format("В г. %s сейчас полночь!", cityName));
            }
            else {
                System.out.println(String.format("В г. %s сейчас %d:%d:%d!",
                        cityName, hours, minutes, seconds));
            }

        }
    }
}
в общем решил задачу, но не понимаю, почему метод printTime() повторяет свою работу 4 раза! В главном методе main мы приостановили главный поток main на 4 секунды, пока не передадим true переменной isStoped. Значит ли это, что пока длится 4 секунды, метод run в классе Clock будет запускаться 4 раза ?