2

My question is related to the answer which was deleted by one of the moderators.

The OP's question was how to check if a Date is greater than other in java.

As I found one external answer which can clearly solve the OP's answer and as we are not allowed to post links as answers.

While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes.

So I have copied the code from the source link and posted it as an answer. I have also given the source link in my answer.

My question:

  1. What modifications should I do to make it visible to future users as it's deleted?
  2. If in future, if I want to post code from external sites then how should I do that (https://stackoverflow.com/help/referencing does not mention about showing code from external sites)?

When you find a useful resource that can help answer a question (from another site or in an answer on Stack Overflow) make sure you do all of the following:

  • Provide a link to the original page or answer
  • Quote only the relevant portion
  • Provide the name of the original author

For the above answer I am not showing the author name, but I am showing the relevant codes and the source link.

3

1 Answer 1

13

Do not copy and paste the contents of the link into your answer. Use your own words and, at most, quote relevant sections from linked resources. Links should only be there for additional information and background, they should not be the answer, and neither should you commit copyright breaches.

See https://stackoverflow.com/help/referencing:

Do not copy the complete text of external sources; instead, use their words and ideas to support your own.

If you can't answer in your own words, at most leave the link in a comment. (and if you can't comment yet, gain enough reputation by other means so you can comment).

This applies to code just as much as to prose. If the point is to illustrate how to use a specific function or API, write your own code to demonstrate.

14
  • will it be ok if I modify the answer having my own codes? Though I have to use some of authors codes Jan 13, 2017 at 11:00
  • @SpringLearner: sure! It if is a technique or specific function call or API, then write your own to show how to use that. Use links to support your argument (see here for more examples, the author explains why FooBar is better here than BarBaz).
    – Martijn Pieters Mod
    Jan 13, 2017 at 11:01
  • As you said Use your own words ,its applicable if we want to show some texts but for codes what shall I do? Jan 13, 2017 at 11:01
  • 1
    @SpringLearner: write your own code. Code is expression too. For 'words' read 'code' and the same applies.
    – Martijn Pieters Mod
    Jan 13, 2017 at 11:02
  • Can you please tell me if it can be undeleted? Jan 13, 2017 at 11:03
  • @SpringLearner: flag the answer for moderator attention once you've edited it.
    – Martijn Pieters Mod
    Jan 13, 2017 at 11:08
  • @MartijnPieters Will I get my deleted answers back if I edit them with my own words and still keep the pasted blog part? Cause I saw really how those copied answers helped others
    – Ghasem
    Sep 25, 2019 at 5:10
  • @AlexJolig A car helps me get around, but that doesn't make it OK to steal one.
    – philipxy
    Sep 25, 2019 at 7:51
  • @philipxy It's not stealing when you credit the original author! It's helping people to find that blog easier I believe.
    – Ghasem
    Sep 25, 2019 at 8:04
  • @AlexJolig: it is when that’s the only content in the answer. You are getting credit (reputation) for the words of others. Just because you put the name of the owner on a stolen car doesn’t mean that everyone else is okay with you driving it around.
    – Martijn Pieters Mod
    Sep 25, 2019 at 8:19
  • @AlexJolig Stack Overflow is not about helping people find blog posts. Your posts can be undeleted when fixed but you need to be writing original answers, where a blog post is at most used to add support for your answer and as a further reference.
    – Martijn Pieters Mod
    Sep 25, 2019 at 8:22
  • @AlexJolig for the majority of your posts I don’t see any reasons to give you back the reputation for having copied someone else’s work. If you are here to help people you can better write a new, original answer.
    – Martijn Pieters Mod
    Sep 25, 2019 at 8:23
  • @AlexJolig However, I am repeating what I already said in my answer and in my comments to the OP on this answer.
    – Martijn Pieters Mod
    Sep 25, 2019 at 8:25
  • @MartijnPieters Well, that was a long repetition. But Ok. I wouldn't repeat what I've done if you did it sooner. I didn't know about this role. Thanks for clearing things out.
    – Ghasem
    Sep 25, 2019 at 8:46

You must log in to answer this question.

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