import *;
class FileTest
{
public static void main(String []args) throws Exception
{
File fDir=new File(File.separator);
String strFile="java"+File.separator+"javaFile";
File f=new File(fDir,strFile);
String[] names=f.list(new FilenameFilter()
{
public boolean accept(File dir,String name)
{
return name.indexOf(".java")!=-1;
}
});
for(int i=0;i<names.length;i++)
{
System.out.println(names[i]);
}
}
}