Open the output stream and store properties after you have closed the input stream.
try (FileInputStream in = new FileInputStream("First.properties")) {
Properties props = new Properties();
props.load(in);
}
try (FileOutputStream out = new FileOutputStream("First.properties"))
props.setProperty("country", "america");
props.store(out, null);
}