Return to Coding in Java with artEoz – exercises

HashMap iterator

  1. Make sure you have the geometrie resource. If necessary, see the Resources import webpage.
  2. The code below creates a dictionary with several points. Which statement allows you to check the iterator on the keys? key_48
  1. Memory representation of the iterator contains several fields. How many ? One of them has a strange name. What does it mean? key_48
  2. Which statement can get the first point provided by the iterator? key_48
  3. Add statements to check the following items, examine the evolution of the fields next, current and index. Can you imagine what they do? key_48
  4. What test shows whether the iterator still provides access to other keys in the dictionary? key_48 How do we know the end of the iterator? key_48
  5. Write an iteration that displays all the keys of the dictionary, using an iterator. key_48

Back to java exercises list