Monday, 11 March 2013

Create a file in java

Leave a Comment
package harit;

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

public class CreateFile {

	public static void main(String args[]) throws IOException
	{
		File file = new File("D:\\logg.txt");
		if(file.createNewFile())
		{
			System.out.println("Create New File");
		}
		else
		{
			System.out.println("File Already Exist");
		}
	}
}


0 comments:

Post a Comment