How can you list all the files in a directory in Java?
You can use the `listFiles()` method of the `File` class to list all the files and subdirectories in a directory.
Great! You've correctly identified how to list the files in a directory using `listFiles()`.
Can you explain what happens if you call `listFiles()` on a file that is not a directory?