Advertisement
Guest User

Untitled

a guest
Jun 25th, 2019
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. KEY=VALUE
  2.  
  3. 1=value
  4. 2=value
  5. 3=value
  6.  
  7. public void save(HashMap<Integer, String> map) {
  8. try {
  9. File zone1 = new File("zones/zone1");
  10. FileOutputStream fileOut = new FileOutputStream(zone1);
  11. PrintWriter print = new PrintWriter(fileOut);
  12. for (Map.Entry<Integer, String> m : map.entrySet()) {
  13. print.println(m.getKey() + "=" + m.getValue());
  14. }
  15.  
  16. print.flush();
  17. print.close();
  18. print.close();
  19. } catch (Exception e) {
  20. }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement