Problem

In Section 5.3 we said that a class that stores data for you should also manipulate it for...

In Section 5.3 we said that a class that stores data for you should also manipulate it for you, as appropriate.  One might conclude from this statement that a HashSet, for example, should not just store data, but should manipulate the data for you somehow.  For example, consider a HashSet containing a collection of Person objects.  The client of such a class might find it necessary to extract just the names of the people and put them in a new HashSet.  Ideally the HashSet class would have a method to do this extraction for you.  However, there are an unlimited number of ways that the Person objects might be manipulated and so you cannot fill the HashSet class with methods covering all possible cases.

b.         Why wasn't such a method ever added to the HashSet class?

Step-by-Step Solution

Request Professional Solution

Request Solution!

We need at least 10 more requests to produce the solution.

0 / 10 have requested this problem solution

The more requests, the faster the answer.

Request! (Login Required)


All students who have requested the solution will be notified once they are available.
Add your Solution
Textbook Solutions and Answers Search
Solutions For Problems in Chapter 5
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT