package com.bj.csdn;
import java.io.File;
/**
* @author zy
* @date 2016年3月30日 下午1:47:48
*/
public class GetImgName {
public static void main(String[] args) {
File file = new File("c:\\1.jpg");
if(file.exists()){
System.out.println(file.getName());
}else{
System.out.println("文件不存在或文件路径不对!");
}
}
}
import java.io.File;
/**
* @author zy
* @date 2016年3月30日 下午1:47:48
*/
public class GetImgName {
public static void main(String[] args) {
File file = new File("c:\\1.jpg");
if(file.exists()){
System.out.println(file.getName());
}else{
System.out.println("文件不存在或文件路径不对!");
}
}
}