Read a file from resources folder in java

In this post, we will see how to read a file from resources folder in java. If you create a maven project(simple java or dynamic web project) , you will see folder src/java/resources. You can read from resources folder using these simple code.

Project structure:

Java Program:

When you run above program, you will get following output.

Was this post helpful?

Leave a Reply

Your email address will not be published. Required fields are marked *