Hi all...I just wanna confirm about my syntax. please feel free to give any comments. I have these codes:
The while sytax above shows that my program will read file A & B from first until end lines.My Qs:
1. I just don't get what if I put
because when I run my program, it shows no different..but I'm not sure...
2. How to make sure comparison between 2 files that having not equal total line? I mean, need to perform the comparison until finish lines eventhough one of the file might have less line.
Thank you very much
Code:
BufferedReader in1 = new BufferedReader (new FileReader( "A.txt")); BufferedReader in2 = new BufferedReader (new FileReader( "B.txt")); lineFile1 = in1.readLine(); lineFile2 = in2.readLine(); while((lineFile2 != null) [B]&&[/B] (lineFile1 != null)) { ... lineFile1 = in1.readLine(); lineFile2 = in2.readLine();
1. I just don't get what if I put
Code:
while((lineFile2 != null) [B]&&[/B] (lineFile1 != null))
2. How to make sure comparison between 2 files that having not equal total line? I mean, need to perform the comparison until finish lines eventhough one of the file might have less line.
Thank you very much
Comment