title: for loop compilation errors
body: <pre><code>public class contains {
  public static void main(String[] args) {
      int[] array = new int[] {0, 1, 2, 3, 4};
      int sum = 0;
      for (i=0, i&lt;=array.length, i++) {
          if (array[i] == 4) {
              return sum;
          }
          sum++;
      }
      return 0;
  }
  </code></pre>
  
  <p>}</p>
  
  <p>I'm not sure why this code above fails. When I try to compile it, I get errors like below. Why is this happening? I want to see at what index 4 is at in my array.</p>
  
  <pre><code>contains.java:5: error: not a statement
      for (i=0, i&lt;=array.length, i++) {
                 ^
  contains.java:5: error: ';' expected
      for (i=0, i&lt;=array.length, i++) {
                                    ^
  contains.java:5: error: ';' expected
      for (i=0, i&lt;=array.length, i++) {
                                     ^
  contains.java:6: error: illegal start of expression
          if (array[i] == 4) {
          ^
  contains.java:6: error: ')' expected
          if (array[i] == 4) {
            ^
  contains.java:6: error: not a statement
          if (array[i] == 4) {
                       ^
  contains.java:6: error: ';' expected
          if (array[i] == 4) {
                           ^
  contains.java:11: error: illegal start of type
          return 0;
  </code></pre>