public static void main(String [] args)
{
File f=new File("C:");
File [] fl=f.listFiles();
for(int i=0;i<fl.length;i++)
{
if (fi[i].isDirectory())
{
system.out.println("["+fl[i].getName+"]");
}
else
{
system.out.println(fl[i].getName());
}
}
}