//online promotion house
// web designing house
import second.*;
import java.io.File; import java.io.IOException; import java.util.*; // Post decrement operator class Main{ public static void main(String[] args) { try{ File f = new File("FirstFile.txt"); if (f.exists()){ System.out.println("Name: "+ f.getName()); System.out.println("Path: "+ f.getAbsolutePath()); System.out.println("Size: "+ f.length()); System.out.println("Writeable: "+ f.canWrite()); System.out.println("Readable: "+ f.canRead()); } else
{
System.out.println("The File does not exist"); } } catch (Exception exception){ System.out.println("Error Occured = "+exception); } } } |