Online Java Compiler By
JavaTpoint.com
import java.lang.Throwable; public class ThrowablePrintStackTraceExample1 { public static void main(String[] args) throws Throwable { try{ int i=4/0; }catch(Throwable e){ e.printStackTrace(); System.err.println("Cause : "+e.getCause()); } } }
Output