title: storing a sentence from a file to a string java
body: <p>How can I store a sentence from a file to a string, and then store the next line, which is made up of numbers, to a string?</p>
  
  <p>When I use hasNextline or nextLine, none of it works. I am so confused.</p>
  
  <pre><code>     Scanner kb = new Scanner(System.in);
       String secretMessage = null;
       String message, number = null;
       File file = new File(System.in);
       Scanner inputFile = new Scanner(file);
  
       while(inputFile.hasNext())
       {
             message = inputFile.nextLine();
             number = inputFile.nextLine();
       }
  
  
       System.out.println(number + "and " + message);
  </code></pre>