Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Add values to a HashSet by checking the input of the method. for example: if input AAA111, and the key of enr AAA323: ( if

Add values to a HashSet by checking the input of the method.

for example: if input AAA111, and the key of enr AAA323: ( if letters matches)

add the value of both to the Set

image text in transcribed

public static Set match(String a) i 89e 90 91 92 93 94 95 96 97 98 unit HashSet0; new Set = Pattern p = Pattern. compile(" [A-Za-z]+"); Matcher m = p.matcher(a); entry enn.entrySet()) { : for (Map. Entry> for (String value: entry.getValueO) I 100 101 102 103 104 105 106 107 108 109 110 if (entry.getKeyC) == m.groupC)) { unit.add(value); return unit

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

Databases Demystified

Authors: Andrew Oppel

1st Edition

0072253649, 9780072253641

Students also viewed these Databases questions