For printing it out I was thinking of using
while(map. hasNext) {
System.out.println("not sure about this bit") ;
Would this be an option? What would I put to call it on the println part?
Daniel Whyte
Level 17
hasNext
Under discussion
Comments (1)
- Popular
- New
- Old
You must be signed in to leave a comment
Anthony Chalk
16 February 2021, 13:27
Try iterating over the HashMap with a for loop:
Then in the loop, you can get the key with
and the value with
+1