How to read the data from properties file?

public class PropertiesData {

public static void main(String[] args) throws IOException {

    //Reading the data from Properties file

    FileInputStream fis = new FileInputStream(new File(System.getProperty("user.dir") + "\\config.properties"));

    //Creating an object of Properties file
    Properties prop = new Properties();

    //Loading the object of FileInputStream Class
    prop.load(fis);

    //providing the "url" as the key value then it will fatch the respective value of the specified key
    System.out.println(prop.get("url"));
}
}

Design a site like this with WordPress.com
Get started