Take a look at this code below, i completely understand what this program is doing but there is one doubt regarding the output of the program on the console.
using System;
using System.IO;
class program
{
public static void Main()
{
StreamReader myReader = new StreamReader("TextFile1.txt");
string line = "";
while (line != null)
{
line = myReader.ReadLine();
if(line != null)
Console.WriteLine(line);
}
Console.ReadLine();
}
}
and the output as follows

My question is that when i comment off the 'if' statement within the while loop, output is still exactly the same but the cursor moves an extra line down further, and i didn't understand why?
System.IO.File.ReadallLines().