[Solved] TreeMap implementation in java returns only last element [closed]


You are using static in your parameters. This means that everytime you run they get overriden which perfectly explains why you are always getting the last element.

You need to change to this:

private String jobDescription;
private String datasetName;
private String jobName;
private String responsiblePerson;

solved TreeMap implementation in java returns only last element [closed]