Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public String getMostFrequentColor() {
- HashMap<String, Integer> mfc = countColors();
- String mfcStr;
- int mfcInt = 0;
- for (Map.Entry<String, Integer> e: mfc.entrySet()){
- if(e.getValue() > mfcInt){
- mfcStr = e.getKey();
- mfcInt = e.getValue();
- }
- }
- return mfcStr;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement