Sometimes we need to filter out file list based on its extension. For example, filtering out all .mp3 files in a specific folder. To implement such scenarios in Java, we have one inbuilt interface known as FilenameFilter. In this tutorial, we will learn how to use FilenameFilter to filter out files in a specific directory.