public void printStackTrace(PrintStream ps){
  ps.println(fetchStackTrace());
}

public void printStackTrace ( PrintStream ps ) { ps . println ( fetchStackTrace ( ) ) ; }
prints the stack trace of the root exception to a printstream also prints the messages of all the exceptions starting from top exception to the root exception , at the top of stack trace
