title: how to read property name with spaces in java
body: <p>I am trying to load all the property names present in the properties file using the below code:</p>
  
  <pre><code>for(Enumeration&lt;String&gt; en = (Enumeration&lt;String&gt;) prop.propertyNames();en.hasMoreElements();){
  
      String key = (String)en.nextElement();
      System.out.println("Property name is "+key);
  }
  </code></pre>
  
  <p>But my properties file has the below contents:</p>
  
  <pre><code>username=
  password=
  Parent file name=
  Child file name =
  </code></pre>
  
  <p>After running the code I am getting output as :</p>
  
  <pre><code>username password Parent Child
  </code></pre>
  
  <p>If the property name has spaces, it is only returning the first word..</p>
  
  <p>Can any one please tell me how to do this?</p>