(Java)
question 4
Complete the following method to insert a value into an array:
public static void insert(String array[], int numElements, int indexToInsert, String newValue) { if (array.length == numElements) { System.out.println("Array is full. No room to insert."); return; } //start at end and work backwards shifting names down for (int i = numElements; i > indexToInsert; i--) {//fill in the missing line here } array[indexToInsert] = newValue;}
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here