I am trying to get the names of all of the text files in a directory. If the directory has subdirectories then I also want to get any text files in those as well. I am not s
The answer is in the tags of your question. Use recursion. Recursion consists in having a method call itself.
In this case, the method should print all the text files directly under a given directory, and call itself for every subdirectory of the directory.