title: Java - Type Mismatch: Cannot Convert From Element type String[] to List<String>
body: <p>I'm unfamiliar with getters and setters (and basically just Java) but I have to use them for this assignment, so if I did anything wrong with those please tell me.</p>
  
  <p>The more important issue is the error that I am getting on my method. The word for word instructions from my assignment for the particular method I'm working on are: </p>
  
  <blockquote>
    <p>Your processData() method should take all the record data from your ArrayList and add the data into each of your instance fields via your setters.</p>
  </blockquote>
  
  <p>But I keep getting an error that says:</p>
  
  <blockquote>
    <p>Type mismatch: cannot convert from element type String[] to List</p>
  </blockquote>
  
  <p>On the line that says "<code>for (List&lt;String&gt; rowData: content)</code>" on the word content.  </p>
  
  <p>Thank you very much for any help you can give me. </p>
  
  <p>My code so far:</p>
  
  <pre><code>public abstract class Client {
  
    String file = "bank-Detail.csv";
    ArrayList&lt;String[]&gt; bank = new ArrayList&lt;&gt;();
    static Client o[] = new Client[12];
  
    public Client(String file) {
      this.file = file;
    }
  
    private String ID;
    private String Age;
    private String Sex;
    private String Region;
    private String Income;
    private String Married;
    private String Children;
    private String Car;
    private String Save_Act;
    private String Current_Act;
    private String Mortgage;
    private String Pep;
  
    public List&lt;String[]&gt; readData() throws IOException {
      //initialize variable
      int count = 0;
      //name file
      String file = "bank-Detail.txt";
  
      //make array list
      List&lt;String[]&gt; content = new ArrayList&lt;&gt;();
  
      //trycatch for exceptions
      try {
        //file reader
        BufferedReader br = new BufferedReader(new FileReader(file));
        //string to add lines to
        String line = "";
        while ((line = br.readLine()) != null) {
          content.add(line.split(","));
        }
      } catch (FileNotFoundException e) {
        e.printStackTrace();
      }
  
      processData(content);
      return content;
    }
  
    public String getID() {
      return ID;
    }
  
    public void setID(String ID) {
      this.ID = ID;
    }
  
    public String getAge() {
      return Age;
    }
  
    public void setAge(String age) {
      this.Age = age;
    }
  
    public String getSex() {
      return Sex;
    }
  
    public void setSex(String sex) {
      Sex = sex;
    }
  
    public String getRegion() {
      return Region;
    }
  
    public void setRegion(String region) {
      Region = region;
    }
  
    public String getIncome() {
      return Income;
    }
  
    public void setIncome(String income) {
      Income = income;
    }
  
    public String getMarried() {
      return Married;
    }
  
    public void setMarried(String married) {
      Married = married;
    }
  
    public String getChildren() {
      return Children;
    }
  
    public void setChildren(String children) {
      Children = children;
    }
  
    public String getCar() {
      return Car;
    }
  
    public void setCar(String car) {
      Car = car;
    }
  
    public String getSave_Act() {
      return Save_Act;
    }
  
    public void setSave_Act(String save_Act) {
      Save_Act = save_Act;
    }
  
    public String getCurrent_Act() {
      return Current_Act;
    }
  
    public void setCurrent_Act(String current_Act) {
      this.Current_Act = current_Act;
    }
  
    public String getMortgage() {
      return Mortgage;
    }
  
    public void setMortgage(String mortgage) {
      this.Mortgage = mortgage;
    }
  
    public String getPep() {
      return Pep;
    }
  
    public void setPep(String pep) {
      Pep = pep;
    }
  
    public String toString() {
      return "[ID = " + ", age=";
  
      /// ect....
    }
  
    public void processData(List&lt;String[]&gt; content) {
  
      int index = 0;
      for (List&lt;String&gt; rowData : content) {
        //initialize array of objects
        //o[index] = new Client();
  
        //use setters to populate your array of objects
        o[index].setID(rowData.get(0));
        o[index].setAge(rowData.get(1));
        o[index].setRegion(rowData.get(3));
        o[index].setSex(rowData.get(2));
        o[index].setIncome(rowData.get(4));
        o[index].setMarried(rowData.get(5));
        o[index].setChildren(rowData.get(6));
        o[index].setCar(rowData.get(7));
        o[index].setSave_Act(rowData.get(8));
        o[index].setCurrent_Act(rowData.get(9));
        o[index].setMortgage(rowData.get(10));
        o[index].setPep(rowData.get(11));
  
        System.out.println(rowData);
  
        index++;
      }
    }
  
    public void printData() {
    }
  }
  </code></pre>