comparing txt files
I'm making a program that has to compare two txt files, if i make a program that looks like this will it work?
import stuff
publicclass
{
public stat
{
String line1, line2, str;
Scanner filescan1, filescan2
filescan1 =new scannernew("nameoftxtfile");
filescan2 same as above ony with second txt file
while (filescan1.hasNext() && filescan2.hasNext())
line1 = FileScan1.nextLine();
line2 = FileScan2.nextLine();
left = 0;
right = str.length() - 1;
if (str.charAt(left) == str.charAt(right))
{
left++;
right--;
}
else
System.out.println (Line1 +"Does not match " + Line2);
}
}
does a layout like this seem like it will work, if not any advice?

