title: Iterating over two arrays simultaneously using for each loop in Java
body: <p>Student's names(String[]) and corresponding marks(int[]) are stored in different arrays.</p>
  
  <p>How may I iterate over both arrays together using for each loop in Java ? </p>
  
  <pre><code>void list() {
  
      for(String s:studentNames) {
          System.out.println(s); //I want to print from marks[] alongside.
      }
  }
  </code></pre>
  
  <p>One trivial way could be using index variable in the same loop. Is there a good way to do?</p>