If a thread don’t want to perform any operation for a particular amount of time then we should go for sleep() method.
- public static native void sleep(long ms) throws interruptedException
- public static void sleep(long ms, int ns) throws interruptedException