title: Read file from txt and split string using comma
body: <p>Why is it it says that there is no split method found ? I want to split one lines to several parts. But there is error. Why is that so ? </p>
  
  <pre><code> try {
          Scanner a = new Scanner (new FileInputStream ("product.txt"));
  
          while (a.hasNext()){
              System.out.println(a.nextLine()); //this works correctly, all the lines are displayed
              String[] temp = a.split(",");
  
          }
          a.close();
  
      }catch (FileNotFoundException e){
          System.out.println("File not found");
      }
  </code></pre>