title: List cannot be resolved
body: <p>Hey I'm having an error "list cannot be resolved". Here is my code:</p>
  
  <pre><code>import java.util.ArrayList;
  import java.util.List;
  import java.util.Scanner;
  
  public class Objects {
  
      void inputData() {
  
          Objects object = new Objects();
          DaneTeleadresowe daneTeleadresowe = new DaneTeleadresowe();
  
          Scanner scanner1 = new Scanner(System.in);
          int ilu = scanner1.nextInt();
  
          Scanner scanner2 = new Scanner(System.in);
  
          List&lt;String&gt; list = new ArrayList&lt;String&gt;();
  
          for (int y=0; y&lt;ilu; y++){
      for(int i=0;i&lt;dataOfSomeSort.tableOfNames.length;  i++){
          System.out.println(dataOfSomeSort.tableOfNames[i]);
          String inputedData = scanner2.nextLine();
          list.add(inputedData);
      }   
  }
  
      void showData(){
  
          Scanner scanner3 = new Scanner(System.in);
          int number = scanner3.nextInt();
  
          if(number &lt; 1) {
              System.out.println("Wrong number.");
          } else if(number&gt;1) {
              int regula = (number*10)-10;
  
              for(int i=regula; i&lt;regula+9; i++) {
                  System.out.println(list.get(regula));
              }
          }
      }     
  }  
  </code></pre>
  
  <p>And in the line: <code>System.out.println(list.get(regula));</code></p>
  
  <p>I have an error. What should i do?</p>
  
  <p>EDIT: List isn't empty for 100%. I just pasted fragment of code with an error inside of it hoping that someone would say how can i resolve a problem with "list-error". I want to add some info to the list and then choose certain "list-lines" and show those data.</p>