If there's an area of personal taste, it's probably in names. Don't be surprised if your answers differ . A. Clear() or erase() both sound OK (depending on whatever the library or other code uses). DeleteAll() seems clunky . Wash() might be OK for a pane-of-glass simulation, but it seems strained for this purpose. B. Push() is traditional; add() is probably OK if that's what everything else in the collection library is using. Insert() seems misleading, since stacks don't put items in the middle. AddToFront() is odd as well; we think of queues having fronts but of stacks as having tops. C. Cut() implies that the text is saved somewhere for pasting. delete() is probably best; clear() and erase() may be OK, but to my ears they sound like they might apply to the whole document. D. Equals() is the out-of-the-box Java word. IdenticalTo() might work if equals() is inappropriate for some reason. Matches() could work, but carries a little baggage suggesting it might be a pattern match. Compare() is the worst of the lot; the other terms let us know "returns true if they're equal"; compare() doesn't tell us which way the answer will come out. |