title: How to pass value from user input in ArrayList<Integer> ?
body: <p>Basically I'm trying to make a program that calculate student marks by adding carry marks(quizzes, assignments, projects etc) with their final exam mark. The program  will ask the user to enter marks for each quizzes, assignments and so on, which we stored in ArrayList, respectively. The problem is, we didn't get the sum of the elements we stored in ArrayList, instead we get sum =0. Could you help? Thanks.</p>
  
  <pre><code>public ArrayList&lt;Integer&gt; getQuizMarks(){
      getQuizData();
      return quizMark;
  }
  
  public void getQuizData() {
      // TODO Auto-generated method stub
  
      for (JTextField txt : txtField) {
          quizMark.add(Integer.parseInt(txt.getText()));
          Calculate();
      }
  }   
  
     public int sizeArray(ArrayList&lt;Integer&gt; getQuizMarks)
     {    
      return quizMark.size();
     }
  
  public int Calculate(){
      List&lt;Integer&gt; array = new ArrayList&lt;Integer&gt;();
      int sum = 0;
      for(int i = 0; i &lt; array.size(); i++){
          sum += array.get(i);
          }
      return sum;
  
  }
  }
  </code></pre>