Check out example codes for "java 8 printstacktrace in system.out". It will help you in understanding the concepts better.

Code Example 1

public static void main(String[] args){
    try {
        test();
    } catch (UnsupportedOperationException e) {
        System.out.println(e);
        e.printStackTrace();
    }
}

private static void test() {
    throw new UnsupportedOperationException("Not yet implemented");
}

Learn ReactJs, React Native from akashmittal.com