 <p>instead of saying if == 1, do</p> <pre><code>for (int i = 0; i &lt; aStudentNumber; i++) { String aStudentName = getInput2(); String aStudentAnswer = getInput3(); int aScore = CalcScore(aStudentAnswer, aMemo); StudentInfo(aStudentName, aScore); } </code></pre> <p>Now, if you want to store that data programmatically so you can access it later on, change your StudentInfo method to something like </p> <pre><code>public static StudentInfo createStudentInfo(String bStudentName, int bScore){ ... return someObj; } </code></pre> <p>where <code>someObj</code> is a an instance of a StudentInfo class (that you have to create) that actually holds all of the data you want to keep track of. Then, simply add that class to a list (inside your loop): </p> <pre><code>ArrayList&lt;StudentInfo&gt; siList = new ArrayList&lt;StudentInfo&gt;(); for (int i = 0; i &lt; aStudentNumber; i++) { String aStudentName = getInput2(); String aStudentAnswer = getInput3(); int aScore = CalcScore(aStudentAnswer, aMemo); //StudentInfo(aStudentName, aScore); // get rid of this line since we are adding it to a list now siList.add(createStudentInfo(aStudentName, aScore)); } </code></pre> <p>Now you can recall all of that data if need be.</p> <p>The biggest thing is that you need a loop. Loop until the index is at your count, and perform the same actions for each answer set.</p> <p>Edit: The following is to address the question posted in the comments.</p> <p>I think you're better off with a constructor. Use a class something like this:</p> <pre><code>public class StudentInfo { private String bStudentName; private int bScore; public StudentInfo (String bStudentName, int bScore) { this.bStudentName = bStudentName; this.bScore = bScore; } public String getStudentName() { return this.bStudentName; //'this' keyword not really necessary, but helpful } public int getScore() { return this.bScore;// again, 'this' not necessary } public void doStuff() { // optional method to do stuff with the data if need be ... } } </code></pre> <p>Then, in your loop, do </p> <pre><code>ArrayList&lt;StudentInfo&gt; siList = new ArrayList&lt;StudentInfo&gt;(); for (int i = 0; i &lt; aStudentNumber; i++) { String aStudentName = getInput2(); String aStudentAnswer = getInput3(); int aScore = CalcScore(aStudentAnswer, aMemo); //StudentInfo(aStudentName, aScore); // get rid of this line since we are adding it to a list now //siList.add(createStudentInfo(aStudentName, aScore)); StudentInfo si = new StudentInfo(aStudentName, aScore); si.doStuff(); // optional method call in case you want to do something with the data other than store it. siList.add(si); } </code></pre> <p>your <code>StudentInfo</code> class should be in the same package as your main class. If, for some reason, it is not, at the top of your main class add <code>include theotherpackage.StudentInfo;</code></p>