Java question

We have the following java code: [java] public class MyObj{ public String att1; 642-374 public Integer att2; public Date att3; } public Map<MyObj, Integer> test(){ Map<MyObj, Integer> map = new HashMap<MyKey, Integer>(); List<MyObj> myObjList = service.getMyObjList(); for (MyObj obj : myObjList){ map.put(obj, obj.att2); } return map; } [/java] Java question: Make changes to test() method […]

by Angel Gruev

May 15, 2013

1 min read

5 - Java question

We have the following java code:

[java]
public class MyObj{
public String att1; 642-374

public Integer att2;
public Date att3;
}

public Map<MyObj, Integer> test(){
Map<MyObj, Integer> map = new HashMap<MyKey, Integer>();

List<MyObj> myObjList = service.getMyObjList();

for (MyObj obj : myObjList){
map.put(obj, obj.att2);
}

return map;
}
[/java]

Java question: Make changes to test() method so the resulting Map is sorted by it keys. The keys must be sorted by their att1 value.https://www.lead4pass.com

IT professional focused on software development having background with software architecture, project management, JAVA, J2EE, Oracle, ADF, BPEL, Integration specialist. Very focused, highly motivated, proactive and quality/detail oriented with strong troubleshooting and problem investigation skills. Passionate about finding new methods for planning and design, project management, training and education.