Java : Using static variable to store Application Specifc Data inside a web based Application 
<p>I am working on a existing web based application which uses static map to store   data  specific to the Application .</p>

<p>This is my  code below  which is responsible to store Data inside a <code>ConcurrentHashMap</code> as shown below .</p>

<pre><code>public class MyClass 

    // Class variable
    private static Map&lt;String, UserThread&gt; usermap = new ConcurrentHashMap&lt;String, UserThread&gt;();  

// Inside a Method 
public void userData()
 {
 UserThread  userThread= usermap.get(getLoginId());
 if (userThread == null) {
 userThread = new UserThread();
 userThread.start();
 usermap.put(getLoginId(), userThread);
 }
}
</code></pre>

<p>The application is working fine , here my question is that  , is this a valid code because can we store Data inside a static variable ?? (Here the Static <code>ConcurrentHashMap</code> contains data specific to the Application ) </p>
