Write a complete method to create a modified ArrayList. Method Specifications The method takes in an ArrayList of Strings as a parameter. The method creates and returns a new ArrayList of Strings that contains only the Strings from the parameter list that start with a letter or digit. Any Strings that do not start with a letter or digit (e.g., start with: & * ! \t etc.) should not be added to the new list. The list parameter should not be changed. Hint: Review the static methods of Character class! Test Cases Here are some lists I suggest using for testing. Parameter ArrayList ["hello!", "?what", "email@com", "#javarules", "3blindmice", "&more"] ["no!", "answers?", "found#here", "4sure"] ["$money", "^carrot", "(parens", ")parensclose", "\ttab"] ["Apple!", "Ball?", "Carrot."] ["1", "2", "3", "4"] ["\"a\"", "\'b\"", "c"] Returned ArrayList ["hello!", "email@com", "3blindmice"] ["no!", "answers?", "found#here", "4sure"] [] ["Apple!", "Ball?", "Carrot."] ["1", "2", "3", "4"] ["c"]
Write a complete method to create a modified ArrayList. Method Specifications The method takes in an ArrayList of Strings as a parameter. The method creates and returns a new ArrayList of Strings that contains only the Strings from the parameter list that start with a letter or digit. Any Strings that do not start with a letter or digit (e.g., start with: & * ! \t etc.) should not be added to the new list. The list parameter should not be changed. Hint: Review the static methods of Character class! Test Cases Here are some lists I suggest using for testing. Parameter ArrayList ["hello!", "?what", "email@com", "#javarules", "3blindmice", "&more"] ["no!", "answers?", "found#here", "4sure"] ["$money", "^carrot", "(parens", ")parensclose", "\ttab"] ["Apple!", "Ball?", "Carrot."] ["1", "2", "3", "4"] ["\"a\"", "\'b\"", "c"] Returned ArrayList ["hello!", "email@com", "3blindmice"] ["no!", "answers?", "found#here", "4sure"] [] ["Apple!", "Ball?", "Carrot."] ["1", "2", "3", "4"] ["c"]
Chapter8: Arrays
Section: Chapter Questions
Problem 9PE
Related questions
Question
Java
![Write a complete method to create a modified ArrayList.
Method Specifications
The method takes in an ArrayList of Strings as a parameter. The method creates and returns a new
ArrayList of Strings that contains only the Strings from the parameter list that start with a letter or
digit. Any Strings that do not start with a letter or digit (e.g., start with: & * ! \t etc.) should not be
added to the new list.
The list parameter should not be changed.
Hint: Review the static methods of Character class!
Test Cases
Here are some lists I suggest using for testing.
Parameter ArrayList
["hello!", "?what", "email@com", "#javarules",
"3blindmice", "&more"]
["no!", "answers?", "found#here", "4sure"]
["$money", "^carrot", "(parens", ")parensclose",
"\ttab"]
["Apple!", "Ball?", "Carrot."]
["1", "2", "3", "4"]
["\"a\"", "\"b\"", "c"]
Returned ArrayList
["hello!", "email@com",
"3blindmice"]
["no!", "answers?", "found#here",
"4sure"]
[]
["Apple!", "Ball?", "Carrot."]
["1", "2", "3", "4"]
["c"]](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F7024c4db-e4c4-44c2-8fab-3045baf15ef1%2F0097db28-12e4-47e4-9354-769f254995df%2F55xu2t9_processed.png&w=3840&q=75)
Transcribed Image Text:Write a complete method to create a modified ArrayList.
Method Specifications
The method takes in an ArrayList of Strings as a parameter. The method creates and returns a new
ArrayList of Strings that contains only the Strings from the parameter list that start with a letter or
digit. Any Strings that do not start with a letter or digit (e.g., start with: & * ! \t etc.) should not be
added to the new list.
The list parameter should not be changed.
Hint: Review the static methods of Character class!
Test Cases
Here are some lists I suggest using for testing.
Parameter ArrayList
["hello!", "?what", "email@com", "#javarules",
"3blindmice", "&more"]
["no!", "answers?", "found#here", "4sure"]
["$money", "^carrot", "(parens", ")parensclose",
"\ttab"]
["Apple!", "Ball?", "Carrot."]
["1", "2", "3", "4"]
["\"a\"", "\"b\"", "c"]
Returned ArrayList
["hello!", "email@com",
"3blindmice"]
["no!", "answers?", "found#here",
"4sure"]
[]
["Apple!", "Ball?", "Carrot."]
["1", "2", "3", "4"]
["c"]
Expert Solution
![](/static/compass_v2/shared-icons/check-mark.png)
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 2 steps with 1 images
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you
![EBK JAVA PROGRAMMING](https://www.bartleby.com/isbn_cover_images/9781337671385/9781337671385_smallCoverImage.jpg)
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
![EBK JAVA PROGRAMMING](https://www.bartleby.com/isbn_cover_images/9781337671385/9781337671385_smallCoverImage.jpg)
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT