小编pok*_*guy的帖子

四舍五入到最接近的100

你如何将整数舍入到最接近的100?例如,497将轮到500,98轮到100,1423轮到1400.

java rounding

2
推荐指数
1
解决办法
931
查看次数

Treemap FirstKey()导入错误

我试图为我的treemap(内存)使用firstKey()方法.我的代码看起来像:

import java.util.*;

//Code in the middle.

System.out.println(memory.firstKey());
Run Code Online (Sandbox Code Playgroud)

但它给了我这个错误:

GameLogic.java:276: cannot find symbol
symbol  : method firstKey()
location: interface java.util.Map<java.lang.Integer,java.lang.Character>
System.out.println(memory.firstKey());
                                     ^
Run Code Online (Sandbox Code Playgroud)

所有建议都赞赏.如果我也使用lastKey(),也会发生同样的错误.

java treemap

1
推荐指数
1
解决办法
1283
查看次数

标签 统计

java ×2

rounding ×1

treemap ×1