Monday, January 30, 2012

How to make method to wait before returning the value?


try {
Thread.currentThread().sleep(4000);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}

1 comment:

  1. Thread.currentThread().sleep(4000);

    should be written as

    Thread.sleep(4000);

    since sleep is a static method

    ReplyDelete