Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Clonable interface  RSS feed

 
Megha Jain
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When i was reading about clonable interface, i didn't understood this line....
"The clonable interface defines no members" there was no futher explanation about it............ can anyone please explain it?

Thanks
 
Amol Fuke
Ranch Hand
Posts: 129
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Its a marker interface and the clone method is already defined in Object class.
 
Rameshwer Jangra
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Cloneable Interface is a Marker Interface. Marker interfaces are used to specify that a class belongs to a logical family or grouping. These interfaces are used for tagging the classes into a category.

eg. Cloneable Interface enables a class to be cloned using clone() method defined in Object class. If a class does not implements Cloneable Interface, clone() method will throw CloneNotSupportedException.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!