Answered! JAVA 21. What is the line of code to declare and create a generic array. (case and spelling matter- name the array, array)…

JAVA

21. What is the line of code to declare and create a generic array. (case and spelling matter- name the array, array) Use T for the generic placeholder.

22What is the order of the following growth function?    t(n)= 5nlogn + 20n – 4

O(lg n)
O(n^2)
O(1)
O(nlg (n)

23. The following code segment has ______ time complexity?

for(int i = 0; i < n; i++){

for(int j = 0; j < n: j=j*2){

int val = (j*i);

System.out.println(val)

}

}

O(n)
O(n^2)
O(1)
O((n lg n)

24. The versions of an overloaded method are distinguished by their ___________. The number, type, or order of their parameters must be distinct.

headers
none of the above
signatures
documentation

25. Visibility modifiers determine which variables and methods are inherited. ___________ visibility provides the best possible encapsulation that permits inheritance.

package
public
private
protected

Expert Answer

 21.Array<T> generic Type

22.O(n log n)

23.O(n log n)

24.None of the above

25.protected

Still stressed from student homework?
Get quality assistance from academic writers!