I am new to Java Programming and Hashmaps and I have a problem that I need help with.
I have a Hashmap that stores a collection of objects:
private HashMap <String, Turtle> turtles = new HashMap<String, Turtle>();
I also have a collection of shapes which I have added to the Turtle class:
ArrayList<String> shapes = new ArrayList<String>();
What I am trying to do is find a way so that it adds the shape object with a specified name to the turtle object with a specified name by passing the parameters of String turtleName and String shapeName.
I do not know how to go about this with a ArrayList and a Hashmap.
ArrayListcontainsStrings.