title: How to find largest number with arrays, in Java?
body: <p>For this college assignment I am required to use <code>public static int indexOfLargestElement(double[] array)</code>.</p>
  
  <pre><code>public class FindLargest {
  
  public static void main(String[] args) {
  
  public static int indexOfLargestElement(double[] array) {
      return 0;
  }
  {
  int numbers[] = new int[]{(int) 1.9,(int) 2.5,(int) 3.7,2,(int) 1.5, 6, 3, 4, 5, 2};
  
      int largest1 = numbers[0];
  
      for(int i =1;i&lt;numbers.length;i++) {
          int indexOfLargestElement;
              if(numbers[i] &gt; largest1)
              largest1 = numbers[1];
          }
      }
  
  
      System.out.println("Largest Element Number is: " + largest1); 
  
      return.largest; 
  }
  </code></pre>