Basic encapsulation of Java exception handling __java

Source: Internet
Author: User

The following is my basic encapsulation of exception, the next exception to inherit this base class, continue to expand. Give everyone an unusual preliminary writing.

Package jp.co.yachiyobank.inf.com.frw.baseExp;

Import Java.io.PrintStream;
Import Java.io.PrintWriter;

public class Baseexception extends exception{

 private static final long serialversionuid = 1L;
 
 private throwable throwable;
&NBSP
 /**
  *クラスのコンストラクタ
  * @param なし
  */
 public baseexception () {
  super ();
 }
 
 /**
  *クラスのコンストラクタ
  * @param msgエラーメッセージ
  */
 public Baseexception (String msg) {
  super (msg);
 &NBSP
 
 
 /**
  *クラスのコンストラクタ
  * @param msgエラーメッセージ
  * @ param throwable
  */
 public baseexception (String msg,throwable throwable) {
  super ( msg,throwable);
 }
 
 /**
  *
  * @param なし
  */
 public throwable getexception () {
& Nbsp; throwable=super.getcause ();
    
  return throwable
 .}

/**
*
* @param なし
*/
public void Printstacktrace () {
Super.printstacktrace ();
}

/**
*
* @param printstream
*/
public void Printstacktrace (PrintStream printstream) {
Super.printstacktrace (PrintStream);
}

/**
*
* @param printwriter
*/
public void Printstacktrace (PrintWriter printwriter) {
Super.printstacktrace (PrintWriter);

}

}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.