Complete the code for the calcPower recursive method shown b…

Complete the code for the calcPower recursive method shown below, which is intended to raise the base number passed into the method to the exponent power passed into the method: public static int calcPower(int baseNum, int exponent) { int answer = 0; ________________________ { answer = 1; } else { answer = baseNum * calcPower (baseNum, exponent – 1); } return answer; }

Assume that bands is an ArrayList of String objects, which c…

Assume that bands is an ArrayList of String objects, which contains a number of elements in ascending order. Select a statement to complete the code segment below, which invokes the Java library binarySearch method to search for the string “Beatles”.  If the list does not already contain the string, it should be inserted in an appropriate location so that the list remains sorted. int index = Collections.binarySearch(bands, “Beatles”); if (index < 0) { __________________________ }