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 {
    /**
     * get stack trace message
     * 
     * @param e the Exception
     * @return stack trace message of the Exception
     */
    public static String getStrackTrace(Exception e) {
        StringWriter sw = new StringWriter();
        e.printStackTrace(new PrintWriter(sw, true));
        String str = sw.toString();
        return str;
    }
}