title: reading new line char using java
body: <p>Help guys, i've just seen this example in the web. i would like to use this to print exactly the contents of a text file in the same format containing new lines, but it just prints out the first line. thanks</p>
  
  <pre><code> import java.util.*;
   import java.io.*;
  
        public class Program
        {
            public static void main(String[] args)throws Exception
            {
            Scanner scanner = new Scanner(new FileReader("B:\\input.txt"));
            String str = scanner.nextLine(); 
  
            // Convert the above string to a char array.
            char[] arr = str.toCharArray();
  
            // Display the contents of the char array.
            System.out.println(arr);
            }
        }
  </code></pre>