Suppose a new API feature is added to Java which makes a task much easier. The originally-accepted answer has more than 100 upvotes and is still correct, but it makes no mention of the new feature, which--of course--is only available in newer versions of Java.

Is it more appropriate to add information about that new API feature to the existing "best" answer, or is it better to add a new answer and hope it eventually gets enough upvotes to gain visibility?

Update: more background on my question.

The accepted answer and highest-upvoted answers to Standard concise way to copy a file in Java? mention the complicated ways of copying files in Java prior to Java 7. Note that I originally didn't notice that the third-highest-upvoted answer mentions Files.copy because the bulk of the answer unnecessarily complicates things by using a different Java 7 feature.

If I happened upon that question when there were only 2 highly-upvoted answers and no existing answers mentioned Files.copy, would it have been more appropriate to edit the "core API only" answer to include a section about Java 7's new Files.copy method, or would it have been better to add a separate answer for the Files.copy method and hope for it to catch up to the others?

For example, the bit added may be as simple as this:

Java 7 or newer:

Files.copy(Path from, Path to)

  • 2
    You could add a version info to the answer if you feel it neccessary. Adding unrelated content or replacing the answer would be too radical. – John Dvorak Jun 17 '13 at 22:14
  • @JanDvorak my question doesn't say anything about adding unrelated content or replacing the answer, but perhaps it depends on your interpretation of unrelated. I am purely asking if it is more acceptable to add information about a new API feature which dramatically simplifies the solution even though the original, complicated solution is still valid. – rob Jun 18 '13 at 17:36

You should add a new answer. Content changes to other people's answers are generally frowned upon by the StackOverflow community:

Guidelines for reviewing Suggested Edits

[Reject] Edits that change an answer's explanation or code, with a supposedly 'better' alternative. Even if the proposed solution is better, it should be added as a comment, or a separate answer.

Are collaborative answers discouraged?

...edit it for everything but the content.

| improve this answer | |
  • To clarify, I mean adding more info to an existing answer; not removing or replacing any information. The mods and high-rep users on android.stackexchange.com actively promote the practice of editing existing answers' content. – rob Jun 17 '13 at 22:24
  • 1
    FWIW, I believe that the help documentation encourages wiki-style editing. The SO community has rejected this approach, but other topical sites may have different community guidelines. – George Cummins Jun 17 '13 at 22:26
  • Thanks for the clarification :) – rob Jun 18 '13 at 17:41

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .