Powered by Ajaxy
Digg StumbleUpon LinkedIn YouTube Flickr Facebook Twitter RSS Reset

Java: Check if a file exists

Java: Check if a file exists
{filelink=12359}

import java.io.*;
public class File_Exis
{
  public static void main(String args[])
  	{
    File f = new File("c:/sakoba.txt");
    System.out.println      (f + (f.exists()? " exists " : " the file does not exist "));
  }
}

No comments yet.

Leave a Comment