Stack Overflow на русском Asked by Shdbd Susjebj on November 5, 2021
Требования:
Как-то так:
public static int getCountTheSameFirstName(
Map<String, String> map,
String name) {
int count = 0;
for (String item : map.values()) {
if (item.equals(name)) {
count++;
}
}
return count;
}
public static int getCountTheSameLastName(
Map<String, String> map,
String lastName) {
return map.containsKey(lastName) ? 1 : 0;
}
Answered by Alexandr on November 5, 2021
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP