Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please answer the following questions and make sure to have the answers as detailed as possible, and make sure to answer all of them please.

Please answer the following questions and make sure to have the answers as detailed as possible, and make sure to answer all of them please. it will not take much time, so i request you to please take some of your time out to answer the questions.

1. What are the differences between an Array and an ArrayList?

2. Write a method that removes the smallest value from an ArrayList. [Hint: Integer has a method CompareTo(Integer other) that returns a postive integer if this is greater than other, a negative integer if this is less than other, and 0 if this is equal to other.]

3. Write and test a method: public void filter(ArrayList list1, ArrayList list2), that removes from list1 all objects that are also in list2. Your method should compare the objects using the == operator, NOT equals. [Hint: the contains and IndexOf methods can be used.]

Make sure to answer all of the questions above and have the correct codes/detailed explanations

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

Step: 3

blur-text-image

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

Fundamentals Of Database System

Authors: Elmasri Ramez And Navathe Shamkant

7th Edition

978-9332582705

More Books

Students also viewed these Databases questions

Question

Question in Chemical Engineering 1 3 .

Answered: 1 week ago