Question: Below is java code that must be used, below is questions that I have to do with this code. // highArray.java // demonstrates array class

Below is java code that must be used, below is questions that I have to do with this code. // highArray.java // demonstrates array class with high-level interface // to run this program: C>java HighArrayApp //////////////////////////////////////////////////////////////// class HighArray { private long[] a; // ref to array a private int nElems; // number of data items //----------------------------------------------------------- public HighArray(int max) // constructor { a = new long[max]; // create the array nElems = 0; // no items yet } //----------------------------------------------------------- public boolean find(long searchKey) { // find specified value int j; for(j=0; j 

Below is java code that must be used, below is questions that

Please in Java

Lab 2 Please write your solution based on the partial code from attached "highArray.java" 2.1: Add a method called isFull() which checks if all elements in the array are filled or not. The description of isFull() is: public boolean isFull() In this method, return true if the array is full; or else, return false; Add some code in main) to exercise this method 2.2: Add a method called isEmpty() which checks if the array is not assigned any explicit value The description of isEmpty() is public boolean isEmptyo) In this method, return true if the array is empty; or else, return false; Add some code in main) to exercise this method 2.3: Add a method called getMin) which display the minimum value in the array. or -1 if the array is empty. The description of getMin() is public int getMin() In this method, if the aray is not empty, the minimum value in the array will be returned; or else, return -1 Add some code in main() to exercise this method 2.4: Add a method called setValue(), and the description of setValue is public int setValue(long searchKey) In this method, the array will be examined if searchKey is already in the array. If this is the case, the index of found searchKey in the array will be returned; If searchKey is not in the array, insert it to the array and return the index where it is inserted Add some code in main() to exercise this method

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!