try {
int[] ints=new int[2];
System.out.println(ints[3]);
} catch (Exception e) {
try {
PrintStream printStream = new PrintStream("F:\\log.txt");
Date date=new Date();
SimpleDateFormat simpleDateFormat=new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
printStream.println(simpleDateFormat.format(date));
System.setOut(printStream);
} catch (FileNotFoundException e1) {
throw new RuntimeException("文件创建失败!");
}
e.printStackTrace(System.out);
}
int[] ints=new int[2];
System.out.println(ints[3]);
} catch (Exception e) {
try {
PrintStream printStream = new PrintStream("F:\\log.txt");
Date date=new Date();
SimpleDateFormat simpleDateFormat=new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
printStream.println(simpleDateFormat.format(date));
System.setOut(printStream);
} catch (FileNotFoundException e1) {
throw new RuntimeException("文件创建失败!");
}
e.printStackTrace(System.out);
}