Computer Science, asked by chaya1965potadar, 6 months ago

try(
Thread.sleep(200);
System.out.println("A");
)
catch (Exception ie)
()

Answers

Answered by amananandsuperstar
0

to be the different between our four types of the the system printed I

Explanation:

white print black print cloud

Answered by Jasleen0599
0

JAVA

try(

Thread.sleep(200);

System.out.println("A");

)

catch (Exception ie)

()

  • ​The current thread can be stopped from running for a defined amount of time in milliseconds by using the Thread.sleep() method. IllegalArgumentException will be thrown if the argument value for milliseconds is negative.
  • Another overloaded method, sleep(long millis, int nanos), can be used to pause the current thread's execution for the number of milliseconds and nanoseconds that are supplied. The range of acceptable nanosecond values is 0 to 999999.
  • The thread scheduler and thread.sleep() work together to place the current thread in a wait state for the predetermined amount of time. When the waiting period is over, the thread state is changed to one that is ready for execution and it waits for the CPU. Therefore, the operating system's thread scheduler determines how long the current thread actually sleeps.
  • It always pauses the running of the current thread.
  • System timers and schedulers determine how long a thread actually sleeps before waking up and starting to execute. The real time for sleep for a calm system is close to the designated sleep time, but it will be slightly longer for a busy system.
  • No monitors or locks that the active thread has acquired are lost during thread sleep.

#SPJ2

Similar questions