Is it possible to stack loaded properties in Java? For instance can I do:
Properties properties = new Properties();
properties.load(new FileInputStream(\"file1.
Yes, you need to pass the default properties file in the constructor. Like this you can chain them up.
E.g.:
Properties properties1 = new Properties();
try (BufferedInputStream bis = new BufferedInputStream(new FileInputStream("file1.properties"))){
properties1.load(bis);
}
Properties properties2 = new Properties(properties1);
try (BufferedInputStream bis = new BufferedInputStream(new FileInputStream("file2.properties"))){
properties2.load(bis);
}