Here you can find the source of printStackTrace()
Prints the stack trace of the current thread to the current debugging output stream.
public static synchronized void printStackTrace()
//package com.java2s; public class Main { /**//from w w w.j a v a 2 s .c o m * <p> Prints the stack trace of the current thread to the current * debugging output stream. </p> * * @concurrency GUARDED */ public static synchronized void printStackTrace() { final Throwable throwable = new Throwable(); throwable.printStackTrace(); } }