Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

class.newInstance() Vs object.clone()

 
kri shan
Ranch Hand
Posts: 1478
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
class.newInstance() creates new instance dynamically and object.clone() creates the replica object. What is the difference(both are used for creating instances)?
 
Maneesh Godbole
Saloon Keeper
Posts: 11196
15
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you fully read the API docs for Object#clone() ? What would happen if you invoke the clone() on an object?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic