JAVA IO - Create File

import java.io.File;
import java.io.IOException;

public class CreateFile {
	public static void main(String args[]) {
		File file = new File("c:\\work\\test");
		try {
			if (file.createNewFile()) {
               System.out.println("Created OK");
			} else {
				System.out.println("Created Wrong");
			}
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
}
相關文章
相關標籤/搜索