File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

class.newInstance() Vs object.clone()

 
kri shan
Ranch Hand
Posts: 1453
  • 0
  • 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: 10971
11
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • 0
  • 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