7 13) 13) What does the following statement do? doubletl arraylnew double [101 A
ID: 3915125 • 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
answers
13. d) all the above
explanation : syntax --> int arrayname [] new int[size]; here declaring a arrary of type int and also specifying its size
14. A) private access specifier is used on class fields
explanation: by making data members private its not accessable by outer class in tern protecting te data
15. D) has the same as class
explanation: a constructor by definition is used to construct object, no return type, not even void.
16) compilation error
explanation: as the array elements type is int ..but it is initialiased with hexadecimal NOTE: array elements are always homogenious type
17) value of x[8] is 180
explanation : y =100 , initially x[0] = 100 ..for each loop execution y is icremented by 10, therefore x[1]=110, x[2]= 120......... x[8] = 180
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.