Java examples for File Path IO:Directory
Get name of specified file or directory
import java.io.*; public class Main { public static void main(String[] args) { File file = new File("C://Folder//FileDemo.txt"); /* w w w . ja v a 2 s.c o m*/ String strFileName = file.getName(); System.out.println("File name is : " + strFileName); } }