本帖最后由 天方地圆 于 2014-3-26 11:50 编辑
- class Write implements Runnable
- {
- private PipedOutputStream out;
- Write( PipedOutputStream out)
- {
- this.out = out;
- }
- public void run()
- {
- try
- {
- Thread.sleep(6000);
- out.write("pied lai la ".getBytes());
- out.close();
- }
- catch (IOException e)
- {
- throw new RuntimeException("管道输出流失败");
- }
- }
- }
复制代码 Thread.sleep(6000); 这一行运行 报出错误: 错误: 未报告的异常错误InterruptedException; 必须对其进行捕捉或声明以便抛出?怎么回事。
|