title: Add strings to an array of strings inside for loop using java
body: <p>I have a for loop and I want to add strings to a string array inside that loop.</p>
  <pre><code>    String[] result = new String[5];
      for(int i=0; i&lt;this.registration.length; ++i){ //need to start from index 1 for some calculation
          String stringResult = String.format(&quot;%s(%s)&quot;, this.registration[i].getMarks(), this.registration[i].getGrade());
      
          result = new String(){stringResult};
      }
      System.out.println(Arrays.toString(result));
  </code></pre>
  <p>How can I achieve that? The output should look like this-</p>
  <pre><code>{100(A), 70(B),  0(F)}
  </code></pre>