JAVA SE 中的File
import java.io.File;
public class FileTest{
public static void main(String[] args){
scan("c:/file/ss");
}
public static void scan(String path){
if(path ==null)
return ;
File file = new File(path); //生成一个新的虚拟文件路径
file.mkdirs(); //如果 ‘c:/file/ss’路径不存在,则生成新的文件夹及其父文件夹
String b = "aa.txt"; //在c:/file/ss 生成新文件的名字
File file1 = new File(file,b); //在父文件虚拟路径下c:/file/ss生成一个新的file
//file1.mkdirs();
try{
file1.createNewFile();} //创建这个文件
catch(Exception e){
e.printStackTrace();
}
}
}
相关文档:
Javah生成JNI头文件
假设工程目录下有bin文件夹,bin存放编译好的class文件;
在bin目录下,
......\koalaTest\bin>javah -classpath . -jni com.jni.vikitest
然后在.....\koalaTest\bin 即可找到一个com_jni_Calculator.h头文件,生成成功! ......
Java中的transient,volatile和strictfp关键字
如果用transient声明一个实例变量,当对象存储时,它的值不需要维持。例如:
Java代码
class T {
transient int a; //不需要维持
int b;  ......
public static void getConnAndTableStruct() {
Connection connection = null;
PreparedStatement pstmt = null;
ResultSetMetaData rsmd = null;
try {
// mysql连接
//Class.forName("org.gjt.mm.mysql.Driver");
//connection = DriverManager.g ......
http://babyjoycry.javaeye.com/blog/587527
1. import info.monitorenter.cpdetector.io.CodepageDetectorProxy;
2. import info.monitorenter.cpdetector.io.HTMLCodepageDetector;
3. import info.monitorenter.cpdetector.io.JChardetFacade;
4.
5. import java.io.BufferedReader;
......