arrays - Recursively Create Hasmaps in Java -


I am trying to create a new hashmap for each document as input. In Pseudeocode I can think of something like:

 for  (each input dock) {map & lt; String, string & gt; MapInputNumber = new hashmap & lt; String, string & gt; }   

so you will have 4 documents for:

  mapInput1 mapInput2 mapInput3 mapInput4   

How do I complete Can i

It seems that you are trying to dynamically declare the variable Can not do - the variable they set themselves on compile time, However, you can create a list:

  list & lt; Maps & lt; String, string & gt; & Gt; Maps = new arreelist & lt; Maps & lt; String, string & gt; & Gt; (); (Document document: Docs) for {map & lt; String, string & gt; Map = new hashmap & lt; String, string & gt; (); // Map by map map.add (map); }    

Comments

Popular posts from this blog

mysql - BLOB/TEXT column 'value' used in key specification without a key length -

c# - Using Vici cool Storage with monodroid -

python - referencing a variable in another function? -