-1

I want to use in my code : "Thread.sleep(10000);" in my esclipe

in netbeans it worked and I just included: "import java.io.; import java.net.;" so what should i do in myeclipse to use it

thank u

Chris Sim
  • 4,054
  • 4
  • 29
  • 36

1 Answers1

0

You just need to make sure you handle any exceptions that could arise. Adding a try/catch statement will do the trick:

    try {
       Thread.sleep(500);
    } catch(InterruptedException e) {
       Thread.currentThread().interrupt(); 
    }

Hope this helps!

Fabio Berger
  • 1,016
  • 1
  • 7
  • 5