- Modify the HighArray class to implement the method specifiedbelow, which reads integer data from a file to fill the array. Thefirst integer read from the file should indicate the number ofintegers contained in the file which can be read into thearray.
/**
* Read integers into array from named file. First element in
* file is a count of number of integers contained in thefile.
*
* @param fileName  name of file containing integerdata
*/
void readIntFile(String fileName)
Note: Use the void insert(int value)method defined in the class to add each integer to the array as itis loaded from the file.
Here is a sample code to read datafrom file
import java.io.File;
importjava.io.FileNotFoundException;
import java.util.Scanner;
public class FileReaderSample {
   public static voidmain(String[] args) throws FileNotFoundException {
       Scanner in = newScanner(System.in);
       System.out.println(\"Please enter file name\");
      String s = in.nextLine();
       Scanner input = new Scanner(new File(s));
       int[] arr = newint[100];
       int i = 0;
       while(input.hasNextInt()) {
           int next = input.nextInt();
           arr[i] = next;
           i++;
       }// end while
       int nElems = i;
// Print the array contents
      System.out.println(\"Array Contents\");
       for (i = 0; i            System.out.println(i + \"\t\" + arr[i]);
       }// end for
   }// end main