java hashmap query -
I am reading values from a file and store these values in a hampp, using bufferreader, following By way -
while ((strings str = buffread.readLine ()) Length ()> 1) {hashMap.put (str.substring (0,5), str) ; }
I can also verify that Hashp has all the data that was initially present in the file.
PrintWriter Out = New PrintEvent (Outfile); Set Entries = Hashmap Antiset (); Iterator entry = entry = entries While (entryIter.hasNext ()) {map. Entry entry = (map entry) entry. Object value = entry.getValue (); // Get the value out.println (value.toString ()); }
But it starts composing less number of entries in the file compared to the number of entries in the hashMap1.size ()
or essentially read from the source file.
Although I am due to the printwitter and the flamer, if someone can tell me why this problem is happening, then it will be very helpful.
Regards P1 ng
Maybe you have left this code that you Posted, but you are clearly calling flush ()
and close
on
printWriter
/ FileWriter < / Code> objects when you are done with them?
Comments
Post a Comment