I\'ve these code for searching occurrence in Array-List but my problem is how I can get result
out side of this for loop in integer type cause I need in out side , may be th
List list = new ArrayList();
list.add("aaa");
list.add("bbb");
list.add("aaa");
Map countMap = new HashMap();
Set unique = new HashSet(list);
for (String key : unique) {
int accurNO = Collections.frequency(list, key);
countMap.put(key,accurNO);
System.out.println(key + ": " accurNO);
}