// Collection of code snippets by Arne Vajhøj 
// (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) 
import java.util.*;
import java.io.*;

public class Config {
   private Properties props;

   private static Config instance = null;

   private Config() {
      props = new Properties();
      try {
         props.load(new FileInputStream("C:\\Config.properties"));
      } catch (FileNotFoundException e) {
      } catch (IOException e) {
      }
   }

   public synchronized static Config getInstance() {
      if (instance == null) {
         instance = new Config();
      }
      return instance;
   }

   public int getN() {
      return Integer.parseInt(props.getProperty("N"));
   }

   public String getS() {
      return props.getProperty("S");
   }

   public static void main(String[] args) {
      System.out.println(Config.getInstance().getN());
      System.out.println(Config.getInstance().getS());
   }
}
