title: How to read a configuration file in Java
body: <p>I am doing a project to build <code>thread pooled web server</code>, in which I have to set </p>
  
  <ul>
  <li>the port number on which server listens.</li>
  <li>How many threads are there in thread pool</li>
  <li>Absolute Path of the root directory, and so many points.</li>
  </ul>
  
  <p>One way is to hard code all these variables in the code, that I did. But professionally it is not good.</p>
  
  <p>Now, I want to make one configuration file, in which I put all these data, and at the run time my code fetches these.</p>
  
  <p>How can I make configuration file for the above task ? </p>