The static method Thread.currentThread() returns a reference to the currently ex
ID: 3841946 • Letter: T
Question
The static method Thread.currentThread() returns a reference to the currently executing Thread object. What is the result of this code? Each String in the array lines will output, with a one-second pause between lines Each String in the array lines will output, with no pause in between because this method is not executed in a Thread Each String in the array lines will output, and there is no guarantee that there will be a pause because currentThread() may not retrieve this thread This code will not compile Each String in the lines array will print, with at least a one-second pause between linesExplanation / Answer
Answer : Option D This code will not compile.
Explanation :
The sleep() method must be enclosed in a try/catch block, or the method printAll() must declare it throws the InterruptedException.