I posted yesterday about this but my code was messy. What I'm looking to do is count the number of lines of two separate files and print the line number in a separate thread for each file.
This is what i have:

```
import java.io.File;
import java.util.Scanner;

public class fileReader implements Runnable
{    
    static int count = 0;
    static int count1 = 0;

    public void run()
    {
        try
        {
        Scanner file1 = new Scanner(new File("filetest1.txt"));
        Scanner file2 = new Scanner(new File("filetest2.txt"));

        while (file1.hasNextLine()) 
        {
              count++;
              file1.nextLine();
        }

        while (file2.hasNextLine()) 
        {
              count1++;
              file2.nextLine();
        }
     }
        catch(Exception e)
        {
            count = -1;
            count1 = -1;
        }
}

    public static void main(String[] args) 
    {
            (new Thread(new fileReader())).start();
            System.out.println("File one has " + count + " lines");
            System.out.println("File two has " + count1 + " lines");

    }

}

```

The problem is that it does not work. Can someone point me in the right direction? Thanks.