Joined
Last Seen
-2 Reputation Points
- Strength to Increase Rep
- +0
- Strength to Decrease Rep
- -0
0% Quality Score
- Upvotes Received
- 0
- Posts with Upvotes
- 0
- Upvoting Members
- 0
- Downvotes Received
- 1
- Posts with Downvotes
- 1
- Downvoting Members
- 1
0 Endorsements
Ranked #107.65K
1 Posted Topic
[code=java] //finding out duplicate elements in a list import java.util.*; public class RD { public static void main(String arg[]) { List<String> l = new ArrayList<String>(); l.add("A");l.add("B");l.add("A");l.add("C");l.add("B");l.add("A"); Map<String,Integer> m = new HashMap<String,Integer>(); for(String a : l) { m.put(a,(m.get(a)==null ? 1: m.get(a)+1 )); } System.out.println(m); //OR use the following code Set<String> unique …
The End.
christeenajose