Assume the declaration of the method xMethod is as follows. This means that xMet
ID: 3866251 • Letter: A
Question
Assume the declaration of the method xMethod is as follows. This means that xMethod is sent one object that is an array of double values.
public static void xMethod(double [ ] a);
Which of the following could be used to call xMethod?
a. xMethod(5.7);
b. xMethod(“this one is correct”);
c. double [ ] z = {8.4, 9.3, 10.7};
xMethod( z[2] );
d. double [ ] z;
z = new double[6];
xMethod( z );
Explanation / Answer
d is the correct answer because argument passes to xMethod is double array. In other above three options they are double or String values which are not correct.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.