title: How to separate key value pairs with comma in Java properties file
body: <p>Currently, my property file output looks like this</p>
  
  <pre><code>Name=Frank 
  Email=frank@mail.com
  </code></pre>
  
  <p>based on the following codes</p>
  
  <pre><code>File prop = new File(".properties");
  
  if (!prop.exists()) {
      prop.createNewFile();
  }        
  
  try {
      FileReader reader = new FileReader(prop);
      Properties properties = new Properties();
      properties.load(reader);
      reader.close();
  
      properties.setProperty("Name", name);
      properties.setProperty("Email", email);
  
      FileWriter writer = new FileWriter(prop);
      properties.store(writer, "Settings");
      writer.close();
  
  } catch (IOException ex) {
      Logger.getLogger(PropertiesTest.class.getName()).log(Level.SEVERE, null, ex);
  }
  </code></pre>
  
  <p>I want it to be written in one line, with each key value pair separated by a comma. So it will look like this</p>
  
  <pre><code>Name=Frank, Email=frank@mail.com
  </code></pre>
  
  <p>How can I achieve this? Or is there a way to group each Name and Email key value pairs with a unique identifier? 
  Basically, I want to have multiple Name and Email entries in one property file and to be able to get each of the entry.</p>