title: What does the percentage symbol (%) mean?
body: <p>I ran into some code containing the <code>%</code> symbol inside the array argument.</p>
  
  <p>What does it mean and how does it work?</p>
  
  <p><strong>Example:</strong> </p>
  
  <pre><code>String[] name = { "a", "b", "c", "d" };
  
  System.out.println(name[4 % name.length]);
  System.out.println(name[7 % name.length]);
  System.out.println(name[50 % name.length]);
  </code></pre>
  
  <p><strong>Output:</strong></p>
  
  <pre><code>a
  d
  c
  </code></pre>