List asList = Arrays.asList(array);
Set<String> mySet = new HashSet<String>(asList);
for(String s: mySet){
System.out.println(s + " " + Collections.frequency(asList,s));
}
More Related Contents:
- How to find duplicate elements in array in effective way? I mean to say with very less iterations
- Multiplication based on input integer and return array- Need help in storing array while looping
- How to refacor a code use only loops and simple arrays?
- Why Java Only Allows String[] args as Main method Argument? [duplicate]
- Type mismatch: cannot convert from double to double[]
- I have a function in java which may have bug and I can not find it [closed]
- Arrays.asList() not working as it should?
- How to convert jsonString to JSONObject in Java
- How do I remove objects from an array in Java?
- Array or List in Java. Which is faster?
- A quick and easy way to join array elements with a separator (the opposite of split) in Java [duplicate]
- How to convert an ArrayList containing Integers to primitive int array?
- How to supply value to an annotation from a Constant java
- What is this: [Ljava.lang.Object;?
- Creating an array of objects in Java
- Java function for arrays like PHP’s join()?
- How do I convert a byte array to Base64 in Java?
- [L array notation – where does it come from?
- Working with a List of Lists in Java
- How to get String Array from arrays.xml file
- Java two varargs in one method
- How are arrays implemented in java?
- Arrays.asList(int[]) not working [duplicate]
- How do I sort two arrays in relation to each other?
- How to create ArrayList (ArrayList) from array (int[]) in Java
- How to print Two-Dimensional Array like table
- Explanation on Integer.MAX_VALUE and Integer.MIN_VALUE to find min and max value in an array
- “Actual or formal argument lists differs in length”
- method in class cannot be applied to given types
- How do I create an int array with randomly shuffled numbers in a given range [duplicate]