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?

[1322 byte] By [bebopa] at [2007-10-2 5:37:40]
# 1
yeah, and if lines in each one do not line up then i need to print the two lines in a line that says they don not match,
bebopa at 2007-7-16 1:48:08 > top of Java-index,Java Essentials,Java Programming...