[Solved] How to handle configuration properties in Java [closed]

[ad_1]

Leverage standard Java Properties class. Create a properties file, i.e. conf.properties and load it.

#conf.properties:
key=value

#code
Properties conf = new Properties();
conf.load(new FileInputStream(new File("conf.properties")));
conf.getProperty("key"); // returns "value"

[ad_2]

solved How to handle configuration properties in Java [closed]