Grimeire
Grimeire

Reputation: 349

example of a class that implements Cloneable Java

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.

Upvotes: -5

Views: 504

Answers (1)

user2357112
user2357112

Reputation: 282158

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.

Upvotes: 0

Related Questions