TreeMap implementation in java returns only last element : <p>This is a class whose object I want to put in a TreeMap. </p>

<pre><code>public class JobDefinition  {
    private static String jobDescription;
    private static String datasetName;
    private static String jobName;
    private static String responsiblePerson;
    public JobDefinition(String jobDesc, String dataSet, String jobName2, String person) {
        jobDescription=jobDesc;
        datasetName=dataSet;
        jobName=jobName2;
        responsiblePerson=person;
    }
    public  String getJobDescription() {
        return jobDescription;
    }

    public  String getDatasetName() {
        return datasetName;
    }

    public  String getJobName() {
        return jobName;
    }

    public  String getResponsiblePerson() {
        return responsiblePerson;
    }

}
</code></pre>

<p>Here I am fetching values from Spreadsheet using POI library. TreeMap uses a integer as Key and Object of above class as its value.</p>

<pre><code>for (int rowCount = rowStartIndex+1; rowCount &lt; rowEndIndex; rowCount++) 
    {
        String jobDesc=spreadsheet.getRow(rowCount).getCell(0).toString();
        String dataSet=spreadsheet.getRow(rowCount).getCell(1).toString();
        String jobName=spreadsheet.getRow(rowCount).getCell(2).toString();
        String person =spreadsheet.getRow(rowCount).getCell(3).toString();
        if(!jobName.equals("N/A") &amp;&amp; jobName!=""){
            validJobCount++;
            jobDefinitionInfo.put(validJobCount, new JobDefinition(jobDesc,dataSet,jobName,person));
            }
    }
    for(Map.Entry&lt;Integer,JobDefinition&gt; entry : jobDefinitionInfo.entrySet()) {
          System.out.println(entry.getKey()+"::"+entry.getValue().getJobDescription());
        }
</code></pre>

<p>When all value is set in Map. And I iterate over it. I get correct key but all corresponding values (which is an object of JobDefinition class) against it is the last value which was placed.</p>

<p><strong>Output::</strong></p>

<pre><code>1::Monthly UPDTMEND File
2::Monthly UPDTMEND File
3::Monthly UPDTMEND File
4::Monthly UPDTMEND File
5::Monthly UPDTMEND File
6::Monthly UPDTMEND File
7::Monthly UPDTMEND File
8::Monthly UPDTMEND File
9::Monthly UPDTMEND File
10::Monthly UPDTMEND File
</code></pre>

<p><strong>Expected Output</strong></p>

<pre><code>1::VRSFEND - TRANSACTION SWEEP
2::XCTLOAD 
3::CHEKDATE  - TO IDENTIFY BACKDATED TRANSACTIONS
4::EDITALIVE  
5::EDITB 
6::PRICE LOAD
7::ACCTSIM - run manually 
8::ACCTLIV - run manually by DVG                        
9::Check Sybase jobs
10::Monthly UPDTMEND File
</code></pre>

<p>I feel there is something wrong with Implementation. Please tell me what more should be added to make it run correctly.</p>
