1. Write a Java class called FlexArray that has/does the following Has a private variable array that holds integers as int[] array. Has a private variable capacity that is the maximum number of integers the array can hold. Has a private variable size that shows the number of currently occupied locations. Obviously, copacity > Sire. Capacity tells you how many values the array can hold, not how many it has currently, which is available via the variable size Has a default constructor that sets capacity=10 and allocates array to new int[copacity Then sets size because there is currently no value stored in the array yet. Has a non-default constructor having parameter (int maxEntries) that sets up array to hold maxEntries number of integers, sets capacity maxEntries and size=0. Make sure maxEntries is >0 This array has the property that only consecutive entries starting from location can contain integer values. In other words, the array contains values in locations through size-1, which is equal to a total of size number of values. A method called public void add/intval) adds the integer val at location size of the array as long as size capacity. If size is equal to capacity, there should be an error message saying, Array is full, values cannot be added. add..) method when successful will also increase the size by 1. A method called public int set fint vol int location) that sets the value at location of array to val, returning the old value to the caller (the old value is replaced with the new value val). The method should throw an error, if location size or location , meaning that you can only modify existing values in the array to new values. A method called public int getint location) that returns the value stored at location of the array. The method should throw an error if location size or location