Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
import java.io.PrintWriter;
import java.io.StringWriter;

public class Main {

    public static String getStackTraceString(Throwable t) {
        String value;
        if (t == null) {
            value = "";
        } else {
            final StringWriter stackTrace = new StringWriter();
            t.printStackTrace(new PrintWriter(stackTrace));
            value = stackTrace.toString();
        }
        return value;
    }
}