I am a rank amateur when it comes to Java, so please pardon my question if it seems dumb :-P I have the following code which is designed to count the number of lines in a f
File file = new File("StoreData.txt");
Scanner reader = new Scanner(new FileInputStream(file));
while (reader.hasNext()) {
k++;
reader.nextLine();
}
reader.close();
reader=null;
//reset scanner
reader=new Scanner(new FileInputStream(file));
while (reader.hasNext()) {
System.out.println(reader.nextLine());
}