Multiple choice technology programming languages

sleep() gives delay in ???

  1. millisecond

  2. nanosecond

  3. second

  4. depends on OS

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

Thread.sleep() accepts milliseconds as the parameter, but the actual precision depends on the OS and JVM implementation. The sleep duration is not guaranteed to be exact due to thread scheduling, timer resolution, and system-specific factors. The method may sleep longer than requested but not shorter.