Implement Cloneable using Scala : <p>How to use cloneable interface in Scala to clone the class object?</p>

<p>This code will tell, how cloneable works in Scala and it worked for me.</p>

<pre><code> class CloneableClass extends scala.Cloneable {
   def myMethod: Unit = println("Inside :"+this.getClass)
   override def clone(): CloneableClass =super.clone().asInstanceOf[this.type]
}

class CloneableDemo  {
  val cc = new CloneableClass
  val cc1 = cc.clone()
  cc1.myMethod
}

object CloneObject extends App {
  val cd = new CloneableDemo
}

Output: Inside : class CloneableClass
</code></pre>
