一、Java读取ini文件,参考这里,注意里面提到的google的IniEditor,注意ini文件的编码。html
二、Eclipse java工程中添加java文件。java
三、Java配置classpath添加整个目录的jar能够参考这里(添加一个目录下的全部JAR文件)。git
四、Java中@Override的做用:shell
(1)、加强程序在编译时候的检查,若是该方法并非一个覆盖父类的方法,在编译时编译器就会报错误。json
(2)、能够当作注释,方便阅读。app
五、eclipse报错,参考这里,解决方法为彻底新建工做空间。eclipse
eclipseide
unhandled event loop exceptionoop
no more handlesui
an SWT error has occurred
六、Java去除标点符号和空白字符。(可参考这里)
str.replaceAll("[\\pP\\s\\p{Zs}]", "");
注意:\\p{Zs}并非\\s的超集,好比\\s包含tab符而\\p{Zs}并不包含。
七、java调用shell命令并获取执行结果,若是命令中有管道参考这里:一、二。
八、java读取TXT文件的方法 。
十、关于Java的json。
(1)、各个JSON技术的比较
(2)、Google Gson 使用简介
(3)、Maven仓库:http://mvnrepository.com/artifact/com.google.code.gson/gson
十一、Eclipse没法复制:eclipse 复制粘贴时老是很慢卡住了,决绝方法
十二、Java运行指定类。
java -jar xxx.jar //普通运行 java -classpath xxx.jar com.xxxx.classname //指定类 java -cp xxx.jar com.xxxx.classname //指定类,cp是classpath的简写
1三、isEmpty等同于 string.length() == 0,判断一个String应该这样:(string == null) || (string.isEmpty()) 。
1五、JUnit 报错:java.lang.ClassNotFoundException,Eclipse 菜单 -> Project -> clean 相应项目便可。
package app; import java.io.PrintWriter; import java.io.StringWriter; public class E { public static void main(String[] args) { String str = null; try { System.out.println(str.charAt(0)); //System.out.println(1/0); } catch (Exception e) { System.out.println(e.getMessage()); System.out.println(e.fillInStackTrace().getMessage()); e.printStackTrace(); StringWriter sw = new StringWriter(); e.printStackTrace(new PrintWriter(sw, true)); String strs = sw.toString(); System.out.println("--------------------------------------------"); System.out.println(strs); } } }
N、...
*** walker ***