title: How to create time in java?
body: <p>I've made a simple code with time but I want the it to also be moving, not just printing it out. Hope you guys can help me on this.</p>
  
  <pre><code>import java.text.DateFormat;
  import java.text.SimpleDateFormat;
  import java.util.Calendar;
  
  public class Main {
  public static void main(String[]args){
      DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss");
      Calendar cal = Calendar.getInstance();
      System.out.println(dateFormat.format(cal.getTime()));
  }
  }
  </code></pre>