Discuss / Java / 交作业

交作业

Topic source


int getScore(String name) {

		// 先在Map中查找:

		Integer score = this.cache.get(name);

		if (score == null) {

			// TODO:

			score =findInList(name);

			if(score!=null) {

				Object tmp=cache.put(name, score);

				if(tmp!=null) {

					System.out.println("name:"+name+"is existed.");

				}

			}

			

		}

		return score == null ? -1 : score.intValue();

	}


  • 1

Reply