Check out example codes for "how timer class and display to jtextfield w3schools in java". It will help you in understanding the concepts better.

Code Example 1

import java.time.LocalTime;  // import the LocalTime class

public class MyClass {  
  public static void main(String[] args) {  
    LocalTime myObj = LocalTime.now();
    System.out.println(myObj);
  }  
}

Learn ReactJs, React Native from akashmittal.com