Hello everyone, I'm currently trying to develop a software using Java. Basecally I have to create a simple algorithm that retrives a file from a folder and it compares to others file in another folder. so far, I have created the algorithm below which compares one file to another. Can anyone suggest any good way of doing it? Also, is it a good idea to proceed this way? thanks in advance....

Algorithm

`
public class Project_2{
public static void main(String [] args)throws IOException{
BufferedReader br3 = new BufferedReader(new FileReader("file_1.txt"));

int y = 0;

int lineSimilar1 = 0;
String line1 ="";
String line2 ="";
int doc=0;
while((line2 = br3.readLine()) != null ){

BufferedReader br4 = new BufferedReader(new FileReader("file_2.txt"));

while((line1 = br4.readLine()) != null){

if(line2.equals(line1)){
lineSimilar1++;

}else{
System.out.println("line not similar");
}

doc++;
}
}
}
}`