Discuss / Java / 练习

练习

Topic source

保持热爱

#1 Created at ... [Delete] [Delete and Lock User]
    int getScore(String name) {        // 先在Map中查找:        Integer score = this.cache.get(name);        if (score == null) {            // TODO:            score = findInList(name);            cache.put(name, score);        }        return score == null ? -1 : score.intValue();    }​

保持热爱

#2 Created at ... [Delete] [Delete and Lock User]

int getScore(String name) {
// 先在Map中查找:
Integer score = this.cache.get(name);
if (score == null) {
score = findInList(name);
cache.put(name, score);
}
return score == null ? -1 : score.intValue();
}


  • 1

Reply