Question: asap 6. Analyze the following code. Numberl) numberArray-new Integer(2) numberArraylo]-new Double(1.5) Which of the following statements is correct? a. You cannot use Number as a
6. Analyze the following code. Numberl) numberArray-new Integer(2) numberArraylo]-new Double(1.5) Which of the following statements is correct? a. You cannot use Number as a data type since it is an abstract class. b. Since each element of numberArray is of the Number type, you cannot assign an Integer object to it. c. Since each element of numberArray is of the Number type, you cannot assign a Double object to it. new Integer[2] is assigned to numberArray. This makes each element of numberArray an Integer object. So you cannot assign a Double object to it 7. Which of the following is a correct interface? a. interface A f void printO (): b. abstract interface A (print):) c. abstract interface A (abstract void print) d. interface A fvoid print( 8 is not a reference type a. A class type b. An interface type c. An array type d. A primitive type 9. Which of the following statements are true? a. The String class implements Comparable. b. The Date class implements Comparable. c. The Double class implements Comparable. d. The Biginteger class implements Comparable. e. All of the above 10. The relationship between an interface and the class that implements it is a. Composition b. Aggregation c. Inheritance d. None
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
