Example usage for java.lang Exception Exception

List of usage examples for java.lang Exception Exception

Introduction

In this page you can find the example usage for java.lang Exception Exception.

Prototype

public Exception(Throwable cause) 

Source Link

Document

Constructs a new exception with the specified cause and a detail message of (cause==null ?

Usage

From source file:Main.java

public static void main(String[] argv) {
    Throwable t = new Exception("from java2s.com");
    t.addSuppressed(new Throwable("from java2s.com"));

}

From source file:Main.java

public static void main(String[] argv) {
    Throwable t = new Exception("from java2s.com");

    System.out.println(t.toString());
}

From source file:Main.java

public static void main(String[] argv) {
    Throwable t = new Exception("from java2s.com");

    t.initCause(new Throwable(""));

}

From source file:Main.java

public static void main(String[] argv) {
    Throwable t = new Exception("from java2s.com");

    Throwable tNew = new Throwable("from java2s.com", t);

}

From source file:Main.java

public static void main(String[] argv) {
    Throwable t = new Exception("from java2s.com");

    t.printStackTrace(System.out);

}

From source file:Main.java

public static void main(String[] argv) {
    Throwable t = new Exception("from java2s.com");

    Throwable tNew = new Throwable(t);

}

From source file:Main.java

public static void main(String[] argv) {
    Throwable t = new Exception("from java2s.com");

    t.printStackTrace();

}

From source file:Main.java

public static void main(String[] argv) {
    Throwable t = new Exception("from java2s.com");

    System.out.println(t.getMessage());

}

From source file:Main.java

public static void main(String[] argv) {
    Throwable t = new Exception("from java2s.com");

    System.out.println(t.getLocalizedMessage());

}

From source file:Main.java

public static void main(String[] argv) {
    Throwable t = new Exception("from java2s.com");

    System.out.println(t.getStackTrace());

}