Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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 removeInst(ArrayList r, Integer n) { // your code here

}

}

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Financial Institutions Management A Risk Management Approach

Authors: Anthony Saunders, Marcia Millon Cornett

9th edition

1259717771, 1259717772, 9781260048186, 1260048187, 978-1259717772

More Books

Students also viewed these Finance questions

Question

What is computer neworking ?

Answered: 1 week ago