Steps to Read/write Property File in java

Create a Java project and create a “config.properties” file under the root folder (project) not under src. Project structure: Config.properties: Reading Property File: Create a class file “PropertyFileRead” and paste the below code, package com.ngdeveloper.com; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; import java.util.Properties; public class PropertyFileRead { public static void main(String[] args) { Properties propFile = new Properties(); try { […]

 1,018 total views

» Read more