Building a bare-minimum Clock using Java!

The Inspiration:

I recently came across a tweet that said "A digital clock is just an electronic chip that executes multiple for loops". I had never thought about digital clocks from that point of view despite looking at them every single day!

That's where I got the idea to work on this and get back to programming after months of development & design work.

The Pre-Coding Work:

Nowadays, before I embark on a coding sprint, I always make sure to take the time and design the solution first. What's the logic behind the solution? What methods & variables should I create? Is there a better approach? How can I minimize redundancy and write cleaner code? This way I avoid a lot of debugging and refactoring(something that has happened to me a lot on my previous projects).

Hence, the first task is sketching a rough outline of the program either as a mindmap or on paper before writing a single line of code.

(Following this advice after engineers online focused on the importance of software design & architecture before developing the software, hence I thought this approach would help me build better products in the future)

I found out that there's an inbuilt 'Clock' class on Java which you could inherit(or import) and call the methods in the superclass to display the time. But, it displayed the current system time along with the timezone, and it wasn't quite what I wanted.

The above program is taken from GeeksForGeeks which displays the system time after execution.

I wanted to build a clock that runs loops and every time the loop runs, the seconds hand increments and then minutes, and then hours.

The Coding:

This is the program I wrote:

public class Clock {

    static int hours;
    static int minutes;
    static int seconds;

    public static void runningClock(){
        for(int frequency = 1; frequency <= 2; frequency++){
            for(hours = 1; hours <= 12; hours++){
                for(minutes = 0; minutes < 60; minutes++){
                    for(seconds =0; seconds < 60; seconds++){
                        System.out.println(hours + ":" + minutes + ":" + seconds);
                        try{
                            Thread.sleep(1000);
                        }catch (InterruptedException e){
                            System.out.println();
                        }
                    }
                }
            }
        }
    }

    public static void main(String[] args) {
        runningClock();
    }
}

A clock runs in two meridians, hence I used the frequency variable to represent it. The clock begins at 1:00:00 and every time the seconds variable increases, I put a thread to sleep by 1000ms(1 second) and display the incremented value. Once executed, your output will look like this:

And this is the output I desired when I thought of programming a clock. Let me know if you find errors in the code or tips to make it better!