# How to use Cloneable?

**URL:** <https://discuss.kotlinlang.org/t/how-to-use-cloneable/2364>\
**Category:** Support\
**Created:** [March 7, 2017, 12:04am UTC](https://discuss.kotlinlang.org/t/how-to-use-cloneable/2364 "2017-03-07T00:04:37Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![abuabdul](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.kotlinlang.org/abuabdul/32/2355_2.png) [@abuabdul](https://discuss.kotlinlang.org/u/abuabdul)\
**Post date:** [March 7, 2017, 8:43am UTC](https://discuss.kotlinlang.org/t/how-to-use-cloneable/2364/3 "2017-03-07T08:43:24Z")

</div>

`clone` is protected hence it will be subclass private in Kotlin. You will want to override the implementation as public so you can use it as you wish.

```
/**
 * Created by abubacker.siddik
 */
open class TempA : Cloneable {
    val s = "123"
    val i = 123
    val d = 1.23

    override public fun clone(): Any {
        return super.clone()
    }
}

```

---

_[View the full topic](https://discuss.kotlinlang.org/t/how-to-use-cloneable/2364)._
