public class Configuration { private static int pageSize; static { Properties prop = new Properties(); InputStream inputStream=Object.class.getResourceAsStream("/default.properties"); try { prop.load(inputStream); pageSize=Integer.valueOf(prop.getProperty("pageSize")); } catch (Exception e) { e.printStackTrace(); } } public static int getPageSize() { return pageSize; } }