请问这两种方法有什么差别呢?
static class MyFilter implements FilenameFilter{
private String type;
public MyFilter(String type){
this.type = type;
}
public boolean accept(File dir,String name){
return name.endsWith(type);
}
}
static class MyFilter implements FilenameFilter{
private String type;
public MyFilter(String type){
this.type = type;
}
public boolean accept(File dir,String name){
return name.endsWith(type);
}
}