The list() method returns an array of pathnames strings that satisfy the specified filter. This method works simillar to list() method, except that returned array must satisfy the filter.
2. Method signature
- FilenameFilter filter - a filename filter
- array of the pathnames
- SecurityException - when we do not have access to the file or directory
3.1. Code snippet that returns the pathnames of
.txt files from
In this article, we presented list(FilenameFilter filter) method that works similar to a simple list() but gives the ability to filter the resulted array.