| Quiz | Posted | Given in class | ||
|---|---|---|---|---|
| 28 | Jan | 30 | Jan | |
Name: Lab Section:
public boolean isPunctuation(char ch)which indicates whether the supplied character is a puncutation symbol. and the constructor for KWIC now also takes a String:
public KWIC(String punctuationChars)so that if I do
KWIC kwic = new KWIC(".,!?");
then every character in the supplied string should be treated as punctuation.
Why can or cannot the isPuncutation method be a static method
for KWIC?
protected?
return (new HashSet()).iterator();How can the Singleton pattern be applied here to save on instances of HashSets?