/**
* Integer.getInteger method reads the given system property
* and returns the result as integer.
*
* If the queried system property is not found it returns default value
*/ int DEFAULT_THREAD_COUNT = 6; int maxThreadCount = Integer.getInteger("MAX_THREAD_COUNT", DEFAULT_THREAD_COUNT);
System.out.println("Max Thread count : " + maxThreadCount);
//Set the system property either through application
//startup parameters (-DMAX_THREAD_COUNT=20) or System.setProperty
System.setProperty("MAX_THREAD_COUNT", "20");