• Post Reply Bookmark Topic Watch Topic
  • New Topic

class.newInstance() Vs object.clone()  RSS feed

 
kri shan
Ranch Hand
Posts: 1487
  • 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
Bartender
Posts: 11445
18
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
Boost this thread!