Hi .. Please consider following example.. where i am reading two files from c:/FileIO folder
This is a class that reads a text file ..
This is the main class
Note : I am reading 2 files from c:/FileIO
Now when i run the MainClass i get an output that is a mingled output from two files...
However on creating a new file ReadingFile, and defining readFile method in it... I get the proper output.. Suddenly
synchronized keyword starts working.. The MainClass remains as it is
Can you please explain the phenomenom behind this..