public class Solution implements Thread.UncaughtExceptionHandler {
@Override
public void uncaughtException(Thread t, Throwable e) {
t.interrupt();
List<StackTraceElement> list = Arrays.asList(e.getStackTrace());
Collections.reverse(list);
for(StackTraceElement es :list){
System.out.println(es.toString());
}
}
public static void main(String[] args) {
}
}
package com.codegym.task.task25.task2512;
/*
Charting our own course
*/
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
public class Solution implements Thread.UncaughtExceptionHandler {
@Override
public void uncaughtException(Thread t, Throwable e) {
t.interrupt();
List<StackTraceElement> list = Arrays.asList(e.getStackTrace());
Collections.reverse(list);
for(StackTraceElement es :list){
System.out.println(es.toString());
}
}
public static void main(String[] args) {
}
}