title: How to make java delay for a few seconds?
body: <p>Hey all I have this code. I want to delay my program for a few seconds and display "scanning..." </p>
  
  <p>Here's what I have. This compiles but doesn't delay anything</p>
  
  <pre><code> if (i==1){
  
          try {
              Thread.sleep(1);
          } catch (InterruptedException ie)
          {
              System.out.println("Scanning...");
          }
  
      }
  </code></pre>
  
  <p>thanks in advance
  I have int i = 1 before obviously</p>