Java Help

Associate
Joined
14 Sep 2005
Posts
1,555
Location
All over.
Code:
public class Fraud {

    public static final int ARRSIZE=10000;
    private String [] niNumbers = new String[ARRSIZE];
 
    public Fraud(String file) {
        
        String thisLine;
        
        for (int i = 0; i <= 10000; i++){
            
            try{
                
            BufferedReader br = new BufferedReader (new FileReader (file));
            while ((thisLine = br.readLine()) != null){
                
                niNumbers[i] = thisLine;
                i++;
                System.out.println(thisLine);
            }
            }//end try
            
            catch (IOException e){
                System.err.println("Error: Cannot open " +file +" + e");
                System.exit(-1);
            }//end catch    
        
    
        }//end of for loop    
    } // end of constructor
   
public static void main(String args[]) {
    
        Fraud notts = new Fraud("notts.txt");
        Fraud derbs = new Fraud("derbs.txt");
        Fraud leics = new Fraud("leics.txt");
        
        
        
        String[] duplicates=notts.findDuplicates(derbs);
I'm having a bit of trouble with a bit of coding. I'm trying to compare 3 text files containing a list of strings. I'm trying to find duplicates between these files. Can't work out how to compare the objects once the've been read in.

Can anyone help? Cheers.
 
Back
Top Bottom