Question: There are two files attached to this assignment / DO NOT TOUCH RUNNER FILE : /**U7_L2_Activity_Three.java** import java.util.ArrayList; public class U7_L2_Activity_Three{ public static ArrayList getOdds(ArrayList

 There are two files attached to this assignment / DO NOT

There are two files attached to this assignment / DO NOT TOUCH RUNNER FILE :

/**U7_L2_Activity_Three.java**\

import java.util.ArrayList;

public class U7_L2_Activity_Three{

public static ArrayList getOdds(ArrayList vals){ // Implement method as described in the assignment }

}

=================================================

/**runner_U7_L2_Activity_Three.java**\

import java.util.Scanner; import java.util.ArrayList;

public class runner_U7_L2_Activity_Three{

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(); System.out.println("Enter values:"); for(int i = 0; i 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

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!