Check out example codes for "Unhandled exception: java.lang.InterruptedException". It will help you in understanding the concepts better.

Code Example 1

try {
    Thread.sleep(1500);
} catch(InterruptedException e) {
    System.out.println("got interrupted!");
}

Learn ReactJs, React Native from akashmittal.com