title: Illegal Start of Expression Error in Array
body: <p>I am trying to write a method that prompts the user for the size of an array, and then for the value of each index value, to be tested in another driver. </p>
  
  <p>I keep getting an "] expected" error, and "illegal start of expression" error at the <code>double arr[i]</code> section and was wondering why?</p>
  
  <pre><code>public void setArray(double[] arr)
  {
      int size = sc.nextInt();
  
      double[] array = new double[size];
  
      for(int i = 0; i &lt; size; i++)
      {
          System.out.println("Enter value : ");
          double arr[i] = sc.nextDouble();         //error here
      }       
  }
  </code></pre>
  
  <p>This is what the compiler returns:</p>
  
  <pre><code>GolightlyScottArray.java:26: error: variable arr is already defined in method setArray(double[])
  double[] arr = new double[size];
           ^
  GolightlyScottArray.java:26: error: incompatible types: possible lossy conversion from double to int
  double[] arr = new double[size];
                            ^
  2 errors
  </code></pre>