Change the java code below to handle interrupted exceptions, and also to input the integer to multiply by sleeptime. public class SleepUtilities { /** * Nap between zero and NAP TIME seconds. * /...


Change the java code below to handle interrupted exceptions, and also to input the integer to multiply<br>by sleeptime.<br>public class SleepUtilities<br>{<br>/**<br>* Nap between zero and NAP TIME seconds.<br>* /<br>public static void nap () {<br>nap (NAP_TIME);<br>}<br>/**<br>*<br>Nap between zero and duration seconds.<br>public static void nap (int duration) {<br>int sleeptime<br>try { Thread.sleep(sleeptime*1000); }<br>catch (InterruptedException e) { }<br>(int) (NAP TIME * Math.random () );<br>}<br>private static final int NAP_ TIME<br>5;<br>}<br>

Extracted text: Change the java code below to handle interrupted exceptions, and also to input the integer to multiply by sleeptime. public class SleepUtilities { /** * Nap between zero and NAP TIME seconds. * / public static void nap () { nap (NAP_TIME); } /** * Nap between zero and duration seconds. public static void nap (int duration) { int sleeptime try { Thread.sleep(sleeptime*1000); } catch (InterruptedException e) { } (int) (NAP TIME * Math.random () ); } private static final int NAP_ TIME 5; }

Jun 10, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here