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.

Add Comment