I am really confused about what is the difference between .clone() method or simply putting the = sign between objects while trying to clone it.

Old answer:

The = sign is the assignment operator in java. Having a = b means "I assign to the variable a the value of variable b. If b is an object, then a = b makes a point to the object that b is pointing to. It does not copy the object, nor clone it.

If you want to clone an object you either have to do it by hand (ugly), or have to make the class that has to be clonable to implement Clonable then call clone().

The advantage on clone() over the "ugly" way is that with clone() it's the developer of the class to be cloned that defines how cloning has to be done in order to ensure that the copy is a legit and working copy.

New answer:

'=' creates a new reference to the same object. 'clone()' creates a new physical object with the same attributes as the earlier one

2 Answers
2

Downvote

If you see an answer that is an answer, does not have any severe content or formatting problems, does not exist solely to promote a product or service, and is not rude or abusive, but just doesn't add any useful information you should downvote it. You should do this regardless of the age of the question and answer.

"You should do this regardless of the age of the question and answer." Then why shouldn't we downvote the older ones who already said the same things as this new one ?
– KaiidoMay 27 '17 at 4:16

@Kaiido If you notice any answer that doesn't add anything useful, then you should downvote it. Upvote high quality useful content and downvote low quality content without regard to the age of the content. That is the purpose of the voting system.
– user4639281May 27 '17 at 4:22

2

My point was just that in the case exposed in OP, the newest answer doesn't add anything new. This is actually the exact case where TimeStamp is important.
– KaiidoMay 27 '17 at 4:44

Maybe just maybe try ignoring it? or upvoting both, why being cynical? And if you fear people abusing the system only then downvote. abusing as in lots of users posting same answers over and over again.
– Mohd Abdul MujibMay 27 '17 at 5:01

I do think the timestamp matters a bit. When a question is new, it's very natural that answers of different quality arises. However, months or years after a question has been answered, one can expect people to read previous answers first.
– kluttMay 27 '17 at 10:39

In general, answers that don't contribute anything should be downvoted. If the answer has a legitimate, helpful approach that's simply overshadowed by a truly excellent answer, it may or may not be worth upvoting (you can and should upvote multiple really good answers to the same question, without trying too hard to nitpick which is slightly better), but it's probably not downvote material.

However, if two conditions are true, it's probably deserving of a downvote. The first is that the answer is pretty lackluster and wouldn't get an upvote normally; the second is that there are other answers that were clearly already present before the answer was drafted that correctly cover all the same ground and are reasonably concise already. In this case, the answer has no reason to exist: it adds nothing to the set of answers already there and was either added carelessly, or in bad faith. Either way, it should be downvoted.

There's a bit of an exception to this rule of thumb, though, and that's if the other answers aren't very concise and this one is. An answer that does an excellent job of summarizing the main points of the explanation with far less verbiage than its competitors without leaving confusing misconceptions can be quite worthwhile to have as an alternate viewpoint, and shouldn't be downvoted. In fact, consider upvoting it.

The classic downvote case is where the accepted, upvoted answer from three years ago says something like "Do X;Y;Z;, because X frobs the widget, Y gadginates it, and Z takes the frobbed gadget to do what you want (A and B) without side effects (C)", and another answer comes along saying in effect "Do X;Y;Z;". This isn't a summary. It's just a chopped-off repetition, since there's nothing there that can't be gained from simply copy-pasting the code blocks from the other answer.