java

1. 多级目录下创建文件

	File file = new File("aa/bb/cc.txt");
	File pf = file.getParentFile();
	if(!pf.exists()){
		pf.mkdirs();
	}
	try {
		file.createNewFile();
	} catch (IOException e) {
		e.printStackTrace();
	}

2. htmlparser中如果判断LinkTag是不是邮件地址

link.isMailLink()

3. 获取系统参数

System.getProperty("java.io.tmpdir")

4. 查看内存情况

        double total = (Runtime.getRuntime().totalMemory()) / (1024.0 * 1024);
        double max = (Runtime.getRuntime().maxMemory()) / (1024.0 * 1024);
        double free = (Runtime.getRuntime().freeMemory()) / (1024.0 * 1024);

5、查看class的编译版本:javap -verbose MyClass | findstr "major"

Java 1.2 uses major version 46
Java 1.3 uses major version 47
Java 1.4 uses major version 48
Java 5 uses major version 49
Java 6 uses major version 50
Java 7 uses major version 51
Java 8 uses major version 52
Java 9 uses major version 53

posted on 2015-05-16 18:13  angelshelter  阅读(126)  评论(0编辑  收藏  举报

导航