Compare 2 text files in java and write the difference in both separately into another file
问题 This is the code I have written to perform a validation mechanism for comparing 2 files. I want to know is there a way to write it in a more performing way, because both of my files can have millions of records in it and this I believe will be slow in those cases. I am thinking of adding a Hash map, every time I get occurrence of a line in the file, I will add +1 to key value. If not, the value of the key remains 1. If the record exists in the other map of file 2 , then I remove it from first