我有以下代码:
game.log.fine("HERE" + bestMove.get("score"));
Integer bestScore = Integer.getInteger(bestMove.get("score"));
game.log.fine("THERE" + bestScore);
作为输出,我有:
FINE: HERE50
Dec 9, 2010 11:34:17 AM game.Agent getCloud
FINE: THEREnull
Dec 9, 2010 11:34:17 AM game.Agent getCloud
可能我不得不补充说,bestMove是HashMap<String,String>
。
问题是bestMove.get("score")
给出了一个字符串值(等于"50")。但是如果尝试转换为整数,我会得到null
。
有人知道这里的问题是什么吗?
https://stackoverflow.com/questions/4397328
复制相似问题