Consider this question: Where is the new object created when we call string.concat(string2)?

It was marked as a duplicate of this question (among others): Concatenation operator (+) vs. concat()

The reason being these sentences:

the concat method always produces a new String with the result of concatenation.


it internally creates a new char array buffer, and returns a new string based on that char array.

This indirectly answers the question. What are the rules/opinions of this?

I'm not sure that this is the right way. I can think of two problems.

  1. This is not a duplicate question per se, at least not the the provided question.

  2. I know this is a grey zone, but in this particular case it assumes that the questioner has prerequisite knowledge that would trivialize the question.

However, I can see the benefits with this. If another answer is also answering the original question then why not refer to that answer instead.

What is the "correct" way of handling this?

  • 1
    Without commenting on the accuracy of this closure, in this case your question is closed as a duplicate of multiple questions. Sometimes, there really are multiple of the same question that are all closed... it's a lot of effort but yes we should probably clean those up so everything is pointing directly to one target. However, in many cases, and a personal habit of the closer in your case, questions can potentially be closed as a duplicate of multiple target questions where each of the target questions answers part of your question. This is valid, IMHO, but should be explained by the closer. – TylerH Jul 8 at 14:38
  • 10
    However, I do find it annoying that at least one of the questions used as a target is itself closed as a duplicate of another question. This is lazy, at best. At worst, it indicates an issue that needs to be corrected (probably by someone like the closer who has gold tag badge privileges to do so themselves). In this case, the ultimate target of the duped target question is also used as one of the three targets on your question, creating a somewhat confusing trail. – TylerH Jul 8 at 14:41
  • 1
    @felix-rosén: When you fix a question without having full edit privileges, you should fix all major problems. You only edited the grammar in the post but left it in the title. I probably would have rejected the edit. – BDL Jul 8 at 14:42
  • 1
    I just want to point out that this is not my question, I have only edited it. But yes I agree that if something is closed as a dupe that is not obvious then an explanation is needed. An argument against it for this particular case is that the user is a new contributor and that perhaps an obvious answer is needed. – Felix Rosén Jul 8 at 14:43
  • 1
    @BDL I agree. I missed to edit the title. – Felix Rosén Jul 8 at 14:44
  • @FelixRosén In this case it does look like the closer left multiple comments explaining how it is a duplicate. – TylerH Jul 8 at 14:45
  • 1
    @TylerH Yes, but have in mind that this is after I pressed on it. I do not think it would have happen otherwise, this is speculation though. – Felix Rosén Jul 8 at 14:46
  • @FelixRosén Perhaps, though that's probably always going to be the case -- the banner does mention that it is a duplicate, and provides a message to OP on what to do if they don't think or don't understand how the target question/questions answer this one. While I think it's a good idea to explain how a series of target Qs each serve to partially answer the Q that was closed, I do think that's a lot to ask for someone who might spend a significant amount of time finding accurate dupe targets already. The closer here closes dozens of questions pretty much every day. – TylerH Jul 8 at 14:50
  • 1
    @FelixRosén So asking the closer to explain every question they close this way would be a significant increase in time spent closing questions in and of itself, without also considering the potential harm to the system -- if it now takes n seconds/minutes longer for the closer to close the question, that means other questions might go unclosed longer, allowing for others to answer them, which muddies the signal that we want to send (don't ask/answer duplicate questions). All told, I think providing an explanation when asked is a happy medium. – TylerH Jul 8 at 14:53
  • 2
    @TylerH On a tangential note, closing against a duplicate is sometimes appropriate, as the duplicate might ultimately be a better target than the question it was closed against. (At a glance, though, that doesn't seem to be the case here, so I think you do have a point as far as this concrete situation is concerned.) – duplode Jul 8 at 15:36
  • 4
    I've seen this person around before; they close a lot of Java questions as dupes. Some are questionable, others aren't as questionable. This fits into more of the questionable spectrum since, even though one question satisfies their criteria, they went ahead and added two more to the mix. Would love to see them reply to this one since the point of dupe closure is to provide signposts, and we've got signposts which are pretty worn out and faded right here. – Makoto Jul 8 at 15:58
  • Picture, please. It's been deleted. – JL2210 Jul 11 at 13:44
  • @JL2210: It was even deleted by the close voter. Curious. – Makoto Jul 11 at 15:12

What is the "correct" way of handling this?

Use your judgement and experience. I've seen enough of these questions to know that their answers are already included within broader posts.

In this case, I was not going to clarify my closure unprompted.

My philosophy for duplicates follows from here. If an answer on a different post provides an answer to the question in another, it's likely a duplicate. The likely is a judgement call.

Here, the question claims + concatenation works one way and wants to know how the alternative, concat(), works. My first hunch was to look for a post that explains the differences between the two. I think that's a reasonable expectation for research effort regardless of prerequisite knowledge. I found that first post and the answers there were answers to this question as well.

The two posts I added later were to satisfy your concerns. They also address the behavior of String#concat and help clarify the statements in the first post.

The question was

When a new object is created by String.concat(), is this object created in the java string constant pool or in java heap memory?

The answer in the duplicate was


I don't see how

This indirectly answers the question.

Are you worried that they won't be able to understand that produces a new String means it's created in java heap memory outside of the constant pool? I wouldn't be, since the last thing they wrote in their question is

I know that java concat behind the back uses below method to create a new String object.

which indicates they understand the distinction.

  • 6
    I didn't open this question as to directly target you, hopefully you know this. I'm not worried about anything, other than you being able to provide adequate reasoning for marking a dupe. But to answer your implication, then yes. That is exactly what I am referring to. And furthermore by answering the question: "Does x equals y or z?". With x equals q and assuming that the questioner knows that ´q´ implies ´y´ then it is the very definition of indirectly, thus verifying this discussion. – Felix Rosén Jul 9 at 8:37
  • 2
    @FelixRosén Haha, no stress. I do not feel targeted. But I'm unclear with the example in your comment. The author asked Does concat create a java string in heap memory?. The duplicate answers The concat method creates a java string in heap memory. That's very direct in my view. Duplicates don't necessarily mean the questions are literally the same. We (sometimes) accept duplicates based on the fact that their answers also answer a different/similar question and that's the case here. – Sotirios Delimanolis Jul 9 at 16:14
  • 4
    Closing questions as duplicates allows us to avoid answering the same question repeatedly and to funnel people looking for answers to high quality answers. When you close a question as duplicate because there's a duplicate answer you harm the community by punishing the asker and reducing the diversity of questions/phrasing available for others to find. In cases like this an answer that collates and links to other answers in the context of the question is a much better outcome. – coreyward Jul 9 at 16:17
  • 1
    @coreyward How is the question author punished? They got the answer to their question. That the answer already existed, rather than being repeated just for them, isn't punishing them. And how is having questions closed as duplicates somehow, "reducing the diversity of questions/phrasing available for others to find" The same questions exist out there, whether they're closed as duplicates or not. You seem to think "closing a question as a duplicate" means, "deleting it", but...that's not what is happening. – Servy Jul 10 at 22:03
  • 1
    @Servy Especially for new users, having a question closed is frequently cited as a reason they stopped participating or felt like they weren't knowledgeable enough to participate. As for duplicate answers not being deleted: 1) Sotirios just deleted the question and 2) duplicates show as such in Google search results. – coreyward Jul 11 at 13:39
  • Care to explain why you also decided to delete the question? – Makoto Jul 11 at 15:12
  • @coreyward So you're arguing that the user wasn't punished, they just felt like they were punished even though they weren't? That's...radically different. Duplicates that are more discoverable than the other existing questions on a topic are valuable as signposts, and we want them to stay. But most duplicates aren't useful signposts. When a question isn't adding to the discoverability of the canonical it's not a problem at all for it to be deleted. Why is it a problem for Google to show that it's a duplicate? If someone wants to find the solution, they can click it and get it. – Servy Jul 15 at 13:15

To answer the question on the title, no. It's not OK. When we mark questions as duplicates, we tell future readers (not only the OP) that their question is elsewhere. If we close questions that are only superficial duplicates because we think the other question has the answer, when both questions have context that is not shared, then we are making not only OP but future readers waste their time reading irrelevant information.

But lets put that in a concrete example: this question. Who closed it? At least 2 gold badge owners of the javascript tag. Where they right? No, they were not. In fact, one of them is way out the mark:

Access-Control-Allow-Origin is a response header that comes from the server, not a request header that the client sends. – Barmar Feb 13 '14 at 23:11

(emphasis mine)

Now, if you were anywhere near the manifest v2 migration from Chrome, you will remember that CORS errors on extensions actually came from the browser, not the web server. I wasted ~3 hours reading the answers on the duplicate, trying to figure out how to solve the issue, until someone that actually has expertise in Chrome extension told me where my problem actually lay. That user may be right on most circumstances, but that question wasn't one of them.

The take away of this experience: experts are humans too, they can be wrong, specially if they don't know/aren't aware of the context. Afterwards, I retitled my question once I was more familiar with Chrome.

On your specific case, I would need to defer to someone expert in your particular context. But experts should also know their limits as humans and be aware that even them could be wrong.


Identical answers don't necessarily indicate duplicate questions.

Although duplicate questions should by definition have identical answers.

Here are two interesting examples from the SF stack that demonstrate this. Both sets of questions have been marked duplicates of each other because the answers are the same; but in the question context it seems clear that most reasonable reviewers would consider the questions to not be duplicates.

  • Who was the orc who wanted to leave Mordor and have his own band of brigands?
  • Is there a passage in Lord of the Rings told from the perspective of an orc?


  • Man travels through time, meets four incarnations of himself
  • Man is sitting in his room and gets contradictory advice from two men from the future


  • 7
    SF Stack != Stack Overflow. You're going to have to use the standards from this site. – Makoto Jul 10 at 21:50
  • 1
    @Makoto, sorry about that. I'd have to go back through 10+ years of posts, but I had the SF examples handy. But they serve to illustrate the idea that different questions can have the same answers, I think. BTW, aren't you supposed to be taking a break from meta? Take some time for yourself! – Mark Harrison Jul 10 at 22:18
  • @Makoto you have to use the Stack Exchange standards. They are the same everywhere. The text of both the flags and close reasons, and the system backend is identical. Claiming that SO is different is like saying that we are more human when everyone by definition is human (except a couple of dogs, but they are so smart that everyone believes them humans). – Braiam Jul 10 at 22:23
  • @MarkHarrison: I had my one-month break. I didn't exactly come back thrilled to what happened... – Makoto Jul 10 at 22:30
  • 3
    @Braiam: No, you don't. You use the Stack Exchange standards as a fallback, since each community defines its own standards (case in point - SciFi allows for series identifications based on a loose description or an image; Anime & Manga explicitly disallows this). Stack Overflow is different. The sooner everyone accepts it, the easier this whole thing becomes. – Makoto Jul 10 at 22:32
  • @Makoto so you are ok with people wasting their time trying one answer after another with solutions that will never work, because om the surface it seems to answer one another? – Braiam Jul 10 at 22:48
  • @Makoto, anyways thanks for the reminder about how unpleasant meta can be. – Mark Harrison Jul 11 at 4:00
  • @Braiam: Sorry, not seeing how that follows from what I said... – Makoto Jul 11 at 4:08
  • 1
    @MarkHarrison: Not clear as to what triggered that response, to be honest. But fair's fair, I suppose. – Makoto Jul 11 at 4:10
  • @Makoto simple. You are telling future readers that their answer is elsewhere. They need to then read all the answers trying to find which apply to their case, which may be none. You really need to consider the implications of what you say. – Braiam Jul 11 at 10:53
  • 1
    @Braiam: Oh, I think you're making a commentary on the nature of duplicates. In honesty, the simple fact is that a lot of the questions have already been asked and answered here. If it really is the case that a person who has read through other answers can't find their solution, then a question with that much detail in it would be an order of magnitude better than questions which tacitly state, "I've looked everywhere". But hey - you're fighting the system, not me. – Makoto Jul 11 at 15:11

No. Too often, I have seen too many similar questions closed where the closer thought the two questions would have identical or highly similar answers, but in fact don't have identical or highly similar answers. When in doubt, don't vote-to-close, because someone else may have more knowledge than you.

  • 3
    Can you provide one or more examples? – Peter Mortensen Jul 9 at 17:12
  • @PeterMortensen I don't have time to; anyone who does have an example can edit my post and add them. – noɥʇʎԀʎzɐɹƆ Jul 9 at 17:12
  • 7
    Sounds like you haven't seen this circumstance play out often enough if you don't have a hot-take example. Just for full disclosure: I have a gold badge in Java and I've butted heads with Sotirios on a few of these closures. Your justification to not close a question as a dupe doesn't satisfy since...that's not any reason to avoid closing questions at all. – Makoto Jul 9 at 17:53
  • I agree although it seems others do not. Part of the reason to ask a question is searchability, if someone asks for example how to sanitize queries in Express JS, although another question may have the answer as an offhand remark to the greater whole if the answer is not easily found by someone who doesn't already know the answer it should not be considered a duplicate – Aidan Welch Jul 9 at 20:42
  • 2
    Barring mistakes, duplicate-closevotes aren't performed lightly. If you don't understand how a duplicate answers an original, perhaps it's you who should consider that the other has more knowledge than you? – CodeCaster Jul 10 at 11:10
  • I've seen this particular type of case before, but it's usually a result of the closed-as-duplicate question being confusing or hard to parse. In that case, the question typically looks like a duplicate on first read, but is (relatively) easy to recognise as not actually being one if you can make out the intent and/or have experience with the exact issue being asked about (and can thus recognise it in the MCVE, even if the question's wording is poor or difficult to understand). – Justin Time Jul 10 at 19:13
  • @PeterMortensen, see meta.stackoverflow.com/a/387063/116 – Mark Harrison Jul 10 at 21:08
  • @AidanWelch How is that a problem? If someone searches for how to solve the duplicate question they'll get linked to the question that solved their problem, even if it wasn't what they would have searched for on their own. That is how duplicates can be valuable, and such a duplicate should not be deleted, as it's a useful signpost. Closing such a question would only be a problem if the question was then deleted, which it shouldn't be (if it is in fact a good signpost). – Servy Jul 10 at 21:29
  • Because just one part of a potentially much larger answer is a horrible user experience to make someone search through, it also makes it essentially impossible for other people to answer that question in what could be a potentially better way or to comment on possible solutions – Aidan Welch Jul 11 at 13:14
  • @Makoto I do remember hard examples, I am simply not in the mood to dig them out. – noɥʇʎԀʎzɐɹƆ Jul 11 at 17:55

You must log in to answer this question.

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