Reputation: 349
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-cloneable) 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
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:
If you scroll down on that page, you'll see long lists of classes in various packages that implement Cloneable
.
Upvotes: 0