import java.util.*;public class myArray{    public static void main(String[] args)    {      int myVals = new int[4];
      -----Code here-----
      display("My values are: ", myVals);    }    public static void display(String message, int array[])    {       int arraySize = array.length;       System.out.print(message);       for(int x = 0; x < arraySize; ++x)          System.out.print(array[x] + " ");    }}Using the above code, complete the indicated section with a fill method() to fill each array element with a value of 2. What will be displayed after the display() method is executed?

What will be an ideal response?

Arrays.fill(myVals, 2);?When the display() method is executed, the line will display as:?My values are: 2 2 2 2

Computer Science & Information Technology

You might also like to view...

To place something in the same position on every slide of presentation automatically, insert into:

a. Slide master b. Notes master c. Handout master d. None of the above

Computer Science & Information Technology

Which of the following chart elements CANNOT be formatted?

A) data labels B) plot areas C) data markers D) plot markers

Computer Science & Information Technology