2019独角兽企业重金招聘Python工程师标准>>>
package javaBasic;import java.util.HashMap;
import java.util.Map;
import java.util.Set;/*** * Java Program to find duplicate characters in String.* * * * * * @author http://java67.blogspot.com*/public class FindDuplicateCharacters {public static void main(String args[]) {printDuplicateCharacters("Programming");printDuplicateCharacters("Combination");printDuplicateCharacters("Java");}/** * Find all duplicate characters in a String and print each of them.*/public static void printDuplicateCharacters(String word) {char[] characters = word.toCharArray();// build HashMap with character and number of times they appear in// StringMap