title: BufferedReader "Unknown Source"
body: <p>I am trying to read a file which contains a product description, productCode and a productPrice. I have it so that it will set the variables of Product with each new line until it equals null:</p>
  
  <pre><code>public class ReadFile {
  
  static ArrayList&lt;Product&gt; products = new ArrayList&lt;Product&gt;();
  
  public static void main(String[] args){
  
      String line;
  
      try {
          BufferedReader bufferedReader = new BufferedReader (new FileReader("C:/Users/Tom/Desktop/data.txt"));
  
          while ((line = bufferedReader.readLine()) != null){
              Product product = new Product();
              product.setDescription(bufferedReader.readLine());
              product.setProductCode(bufferedReader.readLine());
              product.setUnitPrice(Integer.parseInt(bufferedReader.readLine()));
              System.out.println(product);
              products.add(product);
              }
      bufferedReader.close();
      }   
      catch(IOException e){
          System.out.println("File not found.");
  
  }}
  </code></pre>
  
  <p>However I get a error when It comes to getting the next product in the file (Pear):</p>
  
  <pre><code>Exception in thread "main" java.lang.NumberFormatException: For input string: "Pear"
  at java.lang.NumberFormatException.forInputString(Unknown Source)
  at java.lang.Integer.parseInt(Unknown Source)
  at java.lang.Integer.parseInt(Unknown Source)
  at controller.ReadFile.main(ReadFile.java:24)
  </code></pre>
  
  <p>This is how the file is set out:</p>
  
  <pre><code>Apple /r 01 /r 99 /r Pear /r 02 /r 88
  </code></pre>
  
  <p>Note: /r Used to represent new line in file.</p>
  
  <p>Where am I going wrong so that it will create a new Product, set the information and repeats until the line equals null?</p>