import java.io.IOException; public class ExceptionTest2 { public ExceptionTest2(){ try { test(); } catch (IOException ex) { ex.printStackTrace(); } } private void test() throws IOException { try { throw new InterruptedException(); } catch (InterruptedException ex) { IOException exception = new IOException(); exception.initCause(ex); throw exception; } } public static void main(String[] args){ new ExceptionTest2(); } }