For unlimited access to Study Guides, a Grade+ subscription is required.
Question 8
Which of the following is FALSE about arrays on Java.
22. Write a method removeNegatives which takes as input an array of int and returns a new array in which only the non-negative values are kept. For example, if the original array contains 10 -2 0 4 -1, your method should return an array of length 3 containing 10 0 4.
19. What values are stored in the array referred to by the variable x after the following code executes? boolean[] x = (true, false, false, false); for (int i = 1; i < x.length; i++) { x[i] = ! (x[i - 1] || x[i]);