title: printf inside for loop
body: <p>I have been playing around with the printf method and I am confused with the output from this code:</p>
  <pre><code>public static void main(String[] args) {
      String[] names = {&quot;Sam, John, George&quot;};
      double[] balances = {1000.97,100.00,87.00};
      for(int i=0; i&lt;names.length; i++){
          System.out.printf(&quot;Hello %s      this is your balance %.2f\n&quot;,names[i],balances[i]);
      }
  
  }
  The output: Hello Sam, John, George      this is your balance 1000.97
  </code></pre>
  <p>I expected three print statements in the console for each person.</p>
  <p>Thank for any help.</p>