Help!! Counting Lines in a text file.
I need to count the number of lines in a text file, the only thing is that we can't use the BufferReader class. Instead we have to use the Scanner class. Any help would be greatly appreciated! I tried this but it didnt work.
Scanner inFile = new Scanner(new FileReader("Document.txt")
int numLines = 0;
while(inFile.hasNextLine())
{
numLines++;
}

