-5

From what I have read about the Cloneable interface its a waste of time but we still have to study it for some reason. I have been going through sample questions but can not find an answer to the one below.

Example of a class that implements clonable?

Anyone have an example of a class that implements cloneable?

---edit---

This question is not a duplicate as this question clearly states that I'm looking for an "Example of a class that implements cloneable?"

The question that ye state it is a duplicate of(stackoverflow.com/questions/4081858/about-java-clone‌​able) does not ask for an example and I had read it and all other cloneable related questions long before posting this question.

rene
  • 41,474
  • 78
  • 114
  • 152
Grimeire
  • 339
  • 1
  • 6
  • 19
  • 4
    There are a lot classes in the jre: https://docs.oracle.com/javase/7/docs/api/java/lang/class-use/Cloneable.html – Jens May 21 '16 at 18:45
  • @AndrewTobilko in the op question he does not mention anything about an example of a class that implements Cloneable – Grimeire May 21 '16 at 18:46
  • @Jens: Oh sweet, I didn't know that tab existed. – user2357112 May 21 '16 at 18:46
  • how is this question a duplicate when there are no other questions here asking for classes that implements clonable? the link that Andrew Tobilko post and since deleted had no mention of a cloneable example(http://stackoverflow.com/questions/4081858/about-java-cloneable). i read it long before i posted. – Grimeire May 21 '16 at 19:31
  • 3
    In the future, reference the similar questipns you've read that didnt answer your question and explain why when asking your question. Not in a passive aggressive manner after the fact. –  Dec 23 '17 at 21:43
  • 1
    @TinyGiant thanks for the advice. i apologize for the passive aggressive manner of my response but i was banned for a few months because of this question and was never told why. Now i know and will do so in future. – Grimeire Dec 23 '17 at 21:51

1 Answers1

0

Most of the Java Collections Framework classes implement it, so classes like ArrayList, LinkedList, and HashMap.

As Jens points out in the comments, there's a "Use" link at the bottom of the Javadoc that takes you to a page full of uses of the Cloneable interface:

enter image description here

If you scroll down on that page, you'll see long lists of classes in various packages that implement Cloneable.

user2357112
  • 260,549
  • 28
  • 431
  • 505