List Info

Thread: Interview Question 27 Jan 2006




Interview Question 27 Jan 2006
user name
2006-01-27 09:01:42
How do you implement prototype pattern in .NET?
How to implement cloning in .NET ?
What is shallow copy and deep copy ?

Cloning is achieved by using ICloneable of the System
namespace. It has
a "Clone" method which actually returns the
reference of the same
copy. Clone method allows a Shallowcopy and not a deep copy.
In Shallow
copy if you make changes to the cloned object it actually
does change
on the main object itself. So how is deep copy achieved, by
using
"ISerializable" interface? So what you do is first
serialize the
object then deserialize backto a complete new copy. Now any
changes to
this new copy do not reflect on the originalcopy of the
object, this is
called as Deep copy.


Full Interview Questions for .NET and SQL Server
http://www
.geocities.com/dotnetinterviews/
Help the community to make job search easier mail your
questions to
shiv_koiralayahoo.com

[1]

about | contact  Other archives ( Real Estate discussion Medical topics )