Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

7 13) 13) What does the following statement do? doubletl arraylnew double [101 A

ID: 3915130 • Letter: 7

Question

7 13) 13) What does the following statement do? doubletl arraylnew double [101 A) Will allow valid subscripts in the range of 0-9 B) Declares arrayl to be a reference to an array of double values C) Creates an instance of an array of 10 double values D) All of the above 14) Data hiding, which means that critical data stored inside the object is protected from code outside 14) the object, is accomplished in Java by: A) using the private access specifier on the class fields B) using the public access specifier on the class methods C) using the private access specifier on the class definition D) using the private access specifier on the class methods 15) A constructor: 15) A) has return type of void B) always has an access specifier of private C) always accepts two arguments D) has the same name âs the class SHORT ANSWER. Write the word or phrase that best completes each statement or answers the question. 16) What is the output of the following code: 16) public class IntArray public static void main(Stringll args) int xI (120, 200, 0x16]; for (int value : x) System.outprint( xli] +" 17) What will be the value of x [8] after the following code has been executed? 17) final int SUB 12; int(] xnew int [SUB]; int y 100; for (int i 0; ?

Explanation / Answer

double [] array1 = new double [10];


It will allow valid subscripts in the range of 0 - 9 and also Creates an instance of an array of 10 double values and also array1 to be a reference to an array of double values.

D.So All the above statements are correct.


Data hiding, which means that critical data stored inside the object is protected from code outside the object, is accomplished in Java by:

B)using the private access specifier on the class fields.

becaue if we specify the method as private it cannot be inherited until it is in the same class so it means Data hiding.


A constructor has the same name as the class.

Answer: D

but it doesn't return void and have any access sprecifier.

16)

public class IntArray
{
public static void main(String[] args) {
int[] x = {120, 200, 016};
for (int i = 0; i < x.length; i++)
System.out.print(x[i] + " ");
}
}

output:
-----------
120 200 14


17)


final int SUB = 12;
int[] x = new int[SUB];
int y = 100;
for(int i = 0; i < SUB; i++)
{
x[i] = y;
y += 10;
}


output:
----------
180

Thanks have a great day.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote