Question: 10. What does overloading mean? A. Defining a subclass method with an identical name, return type, and parameter list that is invoked instead of the
10. What does overloading mean?
A. Defining a subclass method with an identical name, return type, and parameter list that is invoked instead of the parent class method.
B. Defining a subclass method with an identical name and parameter list subclass that is invoked instead of the parent class method.
C. Defining two or more methods in a class with the same name, return type and parameter list, to perform functions that are slightly different from one another.
D. Defining two or more methods in a class with the same name but different return types and parameter lists, to perform function that are slightly different from one another.
E. Defining two or more methods in a class with the same name but different parameter lists, to perform functions that are slightly different from one another.
11. What is the maximum number of locations that a binary search algorithm will have to examine when looking for a particular value in a sorted array of 50 elements?
A. 1
B. 6
C. 7
D. 8
E. 100
14. Which of the following sorting algorithms is not written recursively?
I. selection sort
II. insertion sort
III merge sort
A. I only
B. II only
C. III
D. I and II only
E. II and III only
18. Which of the following exceptions could occur when the following code is run, if the precondition is met?
//precondition: a is not null
Public String doSomething(ArrayList a, int b){
Int I;
String s;
For(I =0; <= a.size(); i++){
s=(String)(a.get(i));
if (s.length() ==b){
return s;
}
}
return null;
}
A. ArithmeticException
B. ArrayIndexOutOfBoundsException
C. ClassCastException
D. IndexOutOfBoundsException
E. NullPointerException
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
