D is correct. The sleep() method must be enclosed in a try/catch block, or the methodprintAll() must declare it throws the InterruptedException. E is incorrect, but it would be correct if the InterruptedException was dealt with (A is tooprecise). B is incorrect (even if the InterruptedException was dealt with) because all Java code,including the main() method, runs in threads. C is incorrect. The sleep() method is static, italways affects the currently executing thread