File handling in JAVA

package com.lalita_ent;
import java.io.File;

public class Main {
public static void main(String[ ] args) {
File x = new File("C:\\test.txt");
if(x.exists()) {
System.out.println(x.getName() + " Its exists!");
}
else {
System.out.println("The file does not exist");
}
}
}

Comments

Popular posts from this blog

Prime Number

star pattern

Gues random number