ExecutionException 异常类解析

package test.java.util.concurrent;


import java.util.concurrent.ExecutionException;
import org.junit.Test;

/**
 * ExecutionException的测试类
 * 执行处理异常
 * @date 2020-07-14 23:09:21
 */
public class ExecutionExceptionTest {
        /**
        * 通过string和throwable初始化
        * @Param
        */
        @Test
        public void testConstruct0()throws Exception{
        ExecutionException testObj=new ExecutionException("1",new Throwable());
                System.out.println(testObj.toString());
        }
        /**
        *通过throwable初始化
        * @Param
        */
        @Test
        public void testConstruct1()throws Exception{
        ExecutionException testObj=new ExecutionException(new Throwable("3213"));
                System.out.println(testObj.getMessage());
        }

}

 

你可能感兴趣的:(jdk源码解析,java,junit,exception,多线程,jdk)