How to delete file in java?

Below java code shows how to delete file

 * Created on 08-2011 Copyright(c) All Rights Reserved.
package com.kodehelp.javaio;


 * Created by
 * Date: 8/27/11
public class DeleteFile {
    public static void main(String args[]){
        File file = new File("/demo.txt");

Please Post Your Comments & Reviews

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.