How to open all files that starts with specific prefix in java?

Viewed 25548

Is there any way to open some of the text files in the directory that starts with a specific name in Java?

For example in my directory I have the following files:

Ab-01.txt
Ab-02.txt
Ab-03.txt
Ab-04.txt
SomethingElse.txt
NotRelated.txt

So now in my Java code I only want to open those files that starts with ā€œAb-ā€œ

4 Answers
Related