Posts
 
Reputation
Joined
Last Seen
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
1 Commented Post
0 Endorsements
Ranked #107.65K
~189 People Reached
Favorite Forums
Favorite Tags
java x 1

1 Posted Topic

Member Avatar for bhavna13

[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 …

Member Avatar for christeenajose
0
189

The End.