Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在 REPL 中使用地图来测试功能并在尝试在地图上运行 .isEmpty() 函数时收到此消息。
以下是创建地图后在控制台中输入的内容:
acronyms.isEmpty();
知道是什么原因造成的吗?我只是想在 REPL 中对我的地图进行故障排除,而不是一个实际的程序,但我对此错误消息感到好奇,因为我认为 .isEmpty() 已内置于地图的功能中。
谢谢!
您从地图而不是 Map.KeySet 中获取 entrySet()。