Question: Instructions Complete the getOdds method so it returns a new ArrayList of Integers containing all odd Integers from the parameter ArrayList vals in the order

 Instructions Complete the getOdds method so it returns a new ArrayList
of Integers containing all odd Integers from the parameter ArrayList vals in
the order they originally appeared. The contents of vals should not change

Instructions Complete the getOdds method so it returns a new ArrayList of Integers containing all odd Integers from the parameter ArrayList vals in the order they originally appeared. The contents of vals should not change For example if an ArrayList containing the Integers 2.5,8, 6, 7, 3, 12 in that order is passed as a parameter to getOdds, it should return an ArrayList containing the Integers 5,7, 3 in that order. Write your getOdds method in the U7 L2 Activity. Three class. Use the runner class to test your method but do not add a main method to your U7 L2 Activity Three.java file or your code will not be scored correctly. Files STATUS NOT SUBMITTED SAVE SUBMIT 2 UZ_L2_Activity_Three.java 4 runner_U7_L2_Activity_T... 1 - import java.util.ArrayList; 3 - public class U7_LZ_Activity Three 5. public static ArrayList getOdds (ArrayList vals) { 6 1 // Implement this method as described in the assignment 7 } 8 9) 10 Files STATUS O NOT SUBMITTED SAVE SUBMIT IN 1 - import java.util.Scanner; 2 import java.util.ArrayList; U7_L2_Activity. Three.java 3 runner_U7_L2_Activity_T... 4 - public class runner_U7_L2_Activity Three 5 7 8 9 10 6. public static void main(String[] args) { Scanner scan = new Scanner(System.in); ArrayList nums = new ArrayList; System.out.println("Enter ArrayList length: "); int len-scan.nextInt(); 11 System.out.println("Enter values:"); for(int i = 0; i

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!