• Post Reply Bookmark Topic Watch Topic
  • New Topic

File list() instance method  RSS feed

 
Dan Silva
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What does the list() method in File do? Thanks.
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24217
38
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you know how to look methods up in the online Javadocs? See

http://java.sun.com/j2se/1.5.0/docs/api/java/io/File.html


Returns an array of strings naming the files and directories 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 strings is returned, one for each file or directory in the directory. Names denoting the directory itself and the directory's parent directory are not included in the result. Each string is a file name rather than a complete path.

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.

 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!