A Set
of Strings
No. 189
Inserting strings into a Set
.
Q: |
Create a
|
A: |
Inserting some string literals is a trivial task. A for-each loop allows iterating over the set to write its content to standard output:
Notice the duplicate name The set contains 3 elements: Tom Jim Eve |