Menu

Given List Integers Write Method Returns New List Elements Sign Negated E Positive Integer Q43887933

static List<Integer> negateAll(List<Integer> a) Given a list of integers a, write a method that returns a new list with all t

Given a list of integers a, write a method thatreturns a new list with all the elements of a with sign negated,i.e., positive integers become negatives and negative integersbecome positives.

static List<Integer> negateAll(List<Integer> a) Given a list of integers a, write a method that returns a new list with all the elements of a with sign negated, i.e., positive integers become negatives and negative integers become positives. Example: [2, -5, 8, 0] ==> [-2, 5, -8, 0] Show transcribed image text static List negateAll(List a) Given a list of integers a, write a method that returns a new list with all the elements of a with sign negated, i.e., positive integers become negatives and negative integers become positives. Example: [2, -5, 8, 0] ==> [-2, 5, -8, 0]

Expert Answer


Answer to Given a list of integers a, write a method that returns a new list with all the elements of a with sign negated, i.e., …

OR