譬如说:MapString>map=newHashMapString>();先拿所有的键:Integer[]keys=map.keySet().toArray(newInteger[0]);然後随机一个键,找出该值:Randomrandom=newRandom();IntegerrandomKey=keys[random.nextInt(keys.length)];StringrandomValue=map.get(randomKey);