Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: Apache License 

import java.io.PrintWriter;
import java.io.StringWriter;
import java.io.Writer;

public class Main {
    public static String getStackTrace(Throwable aThrowable) {
        aThrowable.printStackTrace();
        final Writer result = new StringWriter();
        final PrintWriter printWriter = new PrintWriter(result);
        aThrowable.printStackTrace(printWriter);
        return result.toString();
    }
}