a

a
mail@pastecode.io avatar
unknown
abc
2 years ago
748 B
2
Indexable
Never
for (Entry<Character, Integer> entry : entrySet) {
            if (entry.getValue() > maxCount) {
                maxCount = entry.getValue();
                maxChar = (entry.getKey());
            }
            for (Entry<Character, Integer> ignored : entrySet) {
                if (entry.getValue() > 3) {
                    maxCount2 = entry.getValue();
                    maxChar2 = (entry.getKey());

                }

            }

        }
        System.out.println("Input String : " + fileName);
        System.out.println("Maximum Occurring char and its count :");
        System.out.println(" \"" + maxChar + "\"" + ": " + maxCount);
        System.out.println(" \"" + maxChar2 + "\"" + ": " + maxCount2);
    }