<> Count the number of times each letter appears in a string
import java.util.HashMap; import java.util.Map; import java.util.Set; public
class Test { public static void main(String[] args) { String text =
"asdflkdjfldksajflasjfkldjsfldlasdjflkgjwioeujroiweujrfoj"; Map<Character,
Integer> map = new HashMap<>(); for (int i = 0; i < text.length(); i++) { char
cc= text.charAt(i); if (!map.containsKey(cc)) { map.put(cc, 1); } else { int
count= map.get(cc); map.replace(cc, count + 1); } } Set<Map.Entry<Character,
Integer>> entries = map.entrySet(); for (Map.Entry<Character, Integer> entry :
entries) { System.out.println(entry.getKey() + ":" + entry.getValue()); } } }

Technology
©2019-2020 Toolsou All rights reserved,
Bigtable Paper notes be based on springboot File upload for python Hundred lines of effective code to achieve Hanoi Tower Games ( Minimalist version )2019 Ladder race Lucky lottery (15 branch ) MySQL8.0MGR Single owner / Multi master installation and switching Java Function and use of reflection python Painting love A masterpiece to be handed down !Alibaba Interior products Redis In depth notes and source code data structure C Parking management of language JAVA Interview questions - Find the longest string that does not repeat ( Personal approach )