APIdia Launch Partner
Top Description
java.lang

public Interface Cloneable

Known Direct Subinterfaces
java.security.cert.CertPathBuilderResult, java.security.cert.CertPathParameters, java.security.cert.CertPathValidatorResult, java.security.cert.CertSelector, java.security.cert.CertStoreParameters, java.security.cert.CRLSelector, java.text.CharacterIterator, sun.security.provider.certpath.State
Known Direct Implementers
java.util.ArrayDeque, java.util.ArrayList, java.util.BitSet, java.util.Calendar, java.util.Date, java.util.EnumMap, java.util.EnumSet, java.util.HashMap, java.util.HashSet, java.util.Hashtable, java.util.IdentityHashMap, java.util.LinkedHashSet, java.util.LinkedList, java.util.Locale, java.util.TimeZone, java.util.TreeMap, java.util.TreeSet, java.util.Vector, java.lang.invoke.MemberName, java.net.HttpCookie, java.security.MessageDigest.Delegate.CloneableDelegate, java.security.Signature.Delegate.CloneableDelegate, java.security.cert.PKIXCertPathChecker, java.text.DecimalFormatSymbols, java.text.BreakIterator, java.text.Collator, java.text.DateFormatSymbols, java.text.DigitList, java.text.Format, java.util.concurrent.ConcurrentSkipListMap, java.util.concurrent.ConcurrentSkipListSet, java.util.concurrent.CopyOnWriteArrayList, java.util.jar.Attributes, java.util.jar.Manifest, java.util.zip.ZipEntry, javax.crypto.Mac, com.sun.crypto.provider.GHASH, com.sun.crypto.provider.HmacCore, sun.net.www.MimeEntry, sun.net.www.protocol.http.AuthenticationInfo, sun.security.provider.DigestBase, sun.security.x509.GeneralSubtrees, sun.security.x509.NameConstraintsExtension, sun.util.resources.Bundles.CacheKey, jdk.internal.icu.impl.CharacterIteratorWrapper, jdk.internal.icu.impl.ReplaceableUCharacterIterator, jdk.internal.icu.text.NormalizerBase, jdk.internal.icu.text.UCharacterIterator, jdk.internal.icu.text.UnicodeSet, sun.text.CompactByteArray, sun.text.RuleBasedBreakIterator.SafeCharIterator, sun.text.SupplementaryCharacterData, sun.text.UCompactIntArray, sun.security.ssl.DTLSInputRecord.HandshakeFlight, sun.security.ssl.SSLConfiguration, sun.util.calendar.CalendarDate

A class implements the Cloneable interface to indicate to the java.lang.Object#clone() method that it is legal for that method to make a field-for-field copy of instances of that class.

Invoking Object's clone method on an instance that does not implement the Cloneable interface results in the exception CloneNotSupportedException being thrown.

By convention, classes that implement this interface should override Object.clone (which is protected) with a public method. See java.lang.Object#clone() for details on overriding this method.

Note that this interface does not contain the clone method. Therefore, it is not possible to clone an object merely by virtue of the fact that it implements this interface. Even if the clone method is invoked reflectively, there is no guarantee that it will succeed.

Since
1.0
See Also
java.lang.CloneNotSupportedException, java.lang.Object#clone()