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

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.

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