This is an exercice to introduce the Map
Java interface.
It teaches how to use the HashMap
, LinkedHashMap
and TreeMap
classes.
Instances of heroes from the Hero
class are created, the Avengers.
The purpose is to associate flowers to each Hero with Map
, and:
- display wether the instance
begonia
is contained into the TreeMapparty
- browse the associative array in alphabetical order of hero names, and display, for each of them, its assigned flower