输出流可以重复关闭而不会出错
以下代码中,如果第一次out.close()不报异常,则第二次也不会报 OutputStream out= new FileOutputStream( "c:/temp/result.xls"); out.close(); out.close();
以下代码中,如果第一次out.close()不报异常,则第二次也不会报 OutputStream out= new FileOutputStream( "c:/temp/result.xls"); out.close(); out.close();
引用 double beginTime = System.currentTimeMillis(); //do sth. double endTime = System.currentTimeMillis(); double second = (endTime – beginTime)/1000; double minute = second/60; double hour = minute/60; System.out.println("总耗时:"+second+"秒,"+minute+"分,"+hour+"小时");
String filename= "侬好.txt"; filename = URLEncoder.encode(filename,"utf-8"); response.setHeader("Content-disposition","attachment; filename="+filename);
务必先画一个流程图再写代码,否则,你很难保证不犯错误:要么少写一个break,要么提前continue……
这是在jre代码中写死了的!
‘\u007f’, 单引号不能丢 如果要用字符串,则表示为 String.valueOf(‘\u007f’)
40139.41
全角空格的Unicode码是12288 16进制为 3000 在java里就是 ‘\u3000’
摘自 http://java.sun.com/j2se/1.4.2/docs/tooldocs/windows/javadoc.html JAVADOC TAGS The Javadoc tool parses special tags when they are embedded within a Java doc comment. These doc tags enable you to autogenerate a complete, well-formatted API from your source code. The tags start with an "at" sign (@) and are case-sensitive — they must be typed with the uppercase and lowercase …
一定要确定charset,不要糊里糊涂就这样过去