-2

Working with maps in a REPL to test out functionality and got this message when trying to run the .isEmpty() function on a map.

Here's what was entered in the console after creating a map:

acronyms.isEmpty();

Any idea what might cause this? I am just trying to troubleshoot my map in a REPL so not an actual program but I'm curious about this error message as I thought that .isEmpty() was built into the functionality of maps.

Thanks!

Eric Conklin
  • 539
  • 4
  • 17

1 Answers1

0

You get the entrySet() from a map, not Map.KeySet.

Marcos Vasconcelos
  • 18,136
  • 30
  • 106
  • 167