Below is my starting code. I have learned a bit on HashMaps, created them and used them. But I am having a problem creating a copy of a HashMap I have built. I can recreate a new one, but the idea is to have some Keys & values of a map built, but from another method. My methods are all public. I have created a private myMap in the Class. But when I try to access myMap in another method, the most I get is an empty {}. Occasionally I get 'null' but I figured out at least how to get from nullto to {}. I just want to be able to .getKey... to get the HashMap data.
Hope this is clear? If not will try to send more.
public class CodonCount {
private HashMap<String,Integer> myMap = new HashMap<String,Integer>();
public CodonCount() {
System.out.println("myMap (beginning of Constructor) = " + myMap);
}
public HashMap buildCodonMap(int start, String dna) {
System.out.println("myMap (beginning of buildCodonMap) = " + myMap);
HashMap<String,Integer> myMap = new HashMap<String,Integer>();