title: Creating a repeating timer reminder in Java
body: <p>I want to have a class that changes its own private variables every 2 seconds. I know that if I do something like </p>
  
  <pre><code>import java.util.Timer;
  //...
  Timer timer;
  //...
  timer.schedule(new ChangeSomething(), 2000);
  </code></pre>
  
  <p>It will execute <code>ChangeSomething()</code> after 2 seconds, is there a way to tell it to do something every 2 seconds, or, If I put inside <code>ChangeSomething()</code> </p>
  
  <pre><code>    timer.schedule(new ChangeSomething(), 2000);
  </code></pre>
  
  <p>will it work?</p>
  
  <p>On a side-note, what does <code>timer.cancel()</code> exactly do?</p>