Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Problem 3 : For this problem you will have to review in detail ArrayList, your IOOP materiat that pertains to processing collections and specific features

Problem 3: For this problem you will have to review in detail ArrayList, your IOOP materiat that pertains to processing collections and specific features only available starting with Java 8.
Write a program that keeps track of a collection of individual characters. Use an ArrayList collection as the ONLY datafield of your class. Call the datafield data.
Add the following functionality:
a method called add that allows the addition of one new item (character) at the end of the collection Document how many of the methods you found. How many of the approaches that you used for display could be used for displayReverse? positions 1,4,7,10,13,16,19, etc (if they exist). found.
Develop your own test suite to thoroughly test your solution and include the sample runs in your submission. Below is info from ReviewFrame:
Special consideration: ArrayList collection processing using the following approaches:
direct index access in basic loop (initial language design)
iterators (Iterator/Listlterator)(Java 2 and later)
enhanced (foreach) loop (Java 5 and later)
Java 8(and later)-specific:
forEach method + lambda expression
forEach method + method reference
When to use each approach and their limitations. Investigate in the context of efficiently ?****** implementing the following tasks on an ArrayList collection:
a. displaying the content of the collection starting with the first item and ending with the last item
b. displaying the content of the collection starting with the last item and ending with the first item
c. checking if the content of the collection is a palindrome
"** Important efficiency considerations: no additional storage for the collection, no repeated passes through the collection.
Make sure to test your Lab1P3Driver and place in Lab1P3Sampleruns.txt an extensive number of sample runs on various input data that you have designed.
image text in transcribed

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

Database In Depth Relational Theory For Practitioners

Authors: C.J. Date

1st Edition

0596100124, 978-0596100124

More Books

Students also viewed these Databases questions

Question

=+ (d) Show that a cyclic permutation is ergodic but not mixing.

Answered: 1 week ago