File a = new File("C:\winnt");
String[] b = a.list();
String[] b = a.list();
解决方案 »
- DB2 JDBC failed on sum a DOUBLE TYPE 202601.84 + 249494.82=452096.660000003
- 如何实现HashMap的get()方法重写?
- java 统计,在线等!!!!!!!!!!!!
- 关于Hibernate的Session和SessionFactory
- 想写个计算器!!
- java中 的随机函数 怎么样从100个数中抽取10个
- 如何根据指定的月份得到当前月份的天数?
- 使用BigDecimal进行浮点数运算 会影响效率么?
- 接口引用了其他的类吗
- 那位朋友介绍几个与平台无关的可视化开发工具java,Thanks
- 帮忙看个错,给分
- 怎样才能在JOptionPane.showMessageDialog中正确显示中文?
listFiles
public File[] listFiles()
Returns an array of abstract pathnames denoting the files in the directory denoted by this abstract pathname.
If this abstract pathname does not denote a directory, then this method returns null. Otherwise an array of File objects is returned, one for each file or directory in the directory. Pathnames denoting the directory itself and the directory's parent directory are not included in the result. Each resulting abstract pathname is constructed from this abstract pathname using the File(File, String) constructor. Therefore if this pathname is absolute then each resulting pathname is absolute; if this pathname is relative then each resulting pathname will be relative to the same directory. There is no guarantee that the name strings in the resulting array will appear in any specific order; they are not, in particular, guaranteed to appear in alphabetical order.Returns:
An array of abstract pathnames denoting the files and directories in the directory denoted by this abstract pathname. The array will be empty if the directory is empty. Returns null if this abstract pathname does not denote a directory, or if an I/O error occurs.
Throws:
SecurityException - If a security manager exists and its SecurityManager.checkRead(java.io.FileDescriptor) method denies read access to the directory
list 返回的是文件名