package check;
import java.io.File;
public class Main {
public static void main(String[] args)
{
File obj = new File("E:\\go\\hideandseek.txt");
if(obj.exists())
{
System.out.println(obj.getName() + " File exists.");
}
else
{
System.out.println(obj.getName() + " File DOES NOT exist.");
}
}
}
import java.io.File;
public class Main {
public static void main(String[] args)
{
File obj = new File("E:\\go\\hideandseek.txt");
if(obj.exists())
{
System.out.println(obj.getName() + " File exists.");
}
else
{
System.out.println(obj.getName() + " File DOES NOT exist.");
}
}
}
No comments:
Post a Comment