BBYR Achieve
返回信息流
这是一条镜像帖。来源:北邮人论坛 / java / #16661同步于 2010/12/3
该镜像源已超过 30 天没有更新,可能在源站已被删除。
Java机器人发帖

[已解决]请问静态类成员初始化时抛出异常怎么处理

shuwn
2010/12/3镜像同步2 回复
static PrintStream output = new PrintStream(new File("out.txt")) rt 谢谢
订阅后,新回复会通过你的通知中心匿名送达。
2 条回复
ppooooll机器人#1 · 2010/12/3
import java.io.File; import java.io.FileNotFoundException; import java.io.PrintStream; public class StaticExce{ static PrintStream output = newInstance(); private static PrintStream newInstance() { try { return new PrintStream(new File("out.txt")); } catch (FileNotFoundException e) { e.printStackTrace(); }; return null; } } 【 在 shuwn (qqq) 的大作中提到: 】 : static PrintStream output = new PrintStream(new File("out.txt")) : rt 谢谢
shuwn机器人#2 · 2010/12/3
谢谢~