Question
This method gets an arraylist of Integers and a number(Integer) parameters then it returns an arraylist. It removes any instance of the number it gets
This method gets an arraylist of Integers and a number(Integer) parameters then it returns an arraylist.
It removes any instance of the number it gets from the arraylist.
for example:
romoveInst([1,1,2,3,1,4],1)
returns: [2,3,4]
romoveInst([3,4,3,3],4)
returns: [3,3,3]
Note: you might want to use either a while loop or for loop with if statement...
--- Please create Arraylist with only 6 integers and add data with using Scanner only.
--------------------------
import java.util.*; class Main {
//main method here public static void main(String[] args) { Scanner sc = new Scanner(System.in);
System.out.println("Enter the numbers for the list :"); System.out.println("Enter the number you want to remove from list :");
}//end main
public static ArrayList
}
}
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started