This just happened: Generating random numbers and sorting them out in Java

I see my options as:

  1. Edit out the incorrect answer, replacing the text with a new answer. That doesn't seem right, it had votes already.
  2. Post a new answer?
  3. Add and edit to the original answer, clarifying it is wrong.

I went with option 3, but I'm not sure if that's the best solution.

  • 1
    4. Delete the answer. That would clear the votes, and you can always add a new answer if you aren't satisfied with the other answers.
    – yannis
    Nov 8 '12 at 14:43
  • @YannisRizos how the hell did I miss the delete button?! Nov 8 '12 at 14:43
  • Heh, that I don't know. It's completely up to you, it's your answer, and the edit you've made is probably sufficient, but there's always the option to just remove the answer.
    – yannis
    Nov 8 '12 at 14:45
  • 1
    @YannisRizos Someone else posted a correct answer, I added a new edit pointing to him, but I guess I'll just delete it. Nov 8 '12 at 14:49

If the original answer is wrong, I'd go with either correcting it or deleting the answer if the "corrected" answer is no different for other answers already posted.

However, if you believe that "wrong" answer would be useful to someone, perhaps leave it in but do have it after the correct answer (with a suitable preface). The relevant answer should always come first. Better yet, to keep the post clean, replace the wrong answer with an footnote1 which mentions your previous answer and include a link to the relevant revision of your answer.

1 Here's an example of a quick footnote with a link to the previous revision of your answer. You don't really need to format it this way.

  • The second point is very important, if you are going to keep the wrong answer you should emphasize the correct one and clearly point out what's wrong with the... wrong one. Having the correct answer before the wrong one is a very good suggestion.
    – yannis
    Nov 8 '12 at 14:48
  • Those are good suggestions. In this case, I think my wrong answer will not be useful. It's a misunderstanding of how a method behaves, which I seem to share with others who upvoted it. Nov 8 '12 at 14:51

For me, it depends on if the answer already has votes or not and if I have an alternate solution that is not already posted as another answer.

If my answer has votes already and I have another solution that isn't already posted, I'll edit my answer to post the new solution, and below it leave the old answer prefixed with a note explaining it's my old answer and it's wrong because of xxxx.

If my answer has no votes and I have another solution that isn't already posted, I'll just edit my answer to change it entirely. In some cases where my old answer might seem like an obvious answer, I'll leave it in there as well and explain why its wrong so others don't make the same mistake.

And if its wrong and I don't have a new solution, I delete it regardless of if it has votes or not. Actually, if I ever had a case where my answer was wrong but seems like it would be the logical answer, and has a lot of views/votes, then I would consider keeping it and prefixing the answer with a big notice explaining why it is wrong so others know this solution won't work and not to do it this way.

  • It has votes and comments already. I think I'll delete it, it's just perpetuating a misconception. Someone else has posted a correct answer, but I seem to be the only one upvoting it. Nov 8 '12 at 14:46

You must log in to answer this question.

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