A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
class.newInstance() Vs object.clone()
Joined: Apr 08, 2004
Feb 28, 2010 22:31:03
class.newInstance() creates new instance dynamically and object.clone() creates the replica object. What is the difference(both are used for creating instances)?
Joined: Jul 26, 2007
Feb 28, 2010 23:21:56
Did you fully read the API docs for Object#clone() ? What would happen if you invoke the clone() on an object?
How to ask questions
Donate a pint, save a life!
Onff-turn it on!
It is sorta covered in the
JavaRanch Style Guide
subject: class.newInstance() Vs object.clone()
ways of instantiation
class Class and class literals
creation of object
how many type or how many kind of way we can create an object in java??
Using Class.forName() with constructor arguments
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2013