By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,673 Members | 1,268 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,673 IT Pros & Developers. It's quick & easy.

clone

P: n/a
why implement icloneable which seems to involve writing
public object Clone()
{
return this;
}

when I can do
myobject o1 = new myobject()
myobject o2;

o2 = o1;
Jason,

That's the wrong way to implement a Clone method. Your code simply
returns a reference to an existing object.

Here's an example of how to clone an object:
http://groups.google.com/groups?q=%2...oup:*.dotnet.*
&hl=en&lr=lang_en&ie=UTF-8&oe=UTF-
8&scoring=d&selm=3e89c582%240%2449109%24e4fe514c%4 0news.xs4all.nl&rnu
m=7
See the "Cloning Objects" section in this article:
http://msdn.microsoft.com/msdnmag/is.../06/Instincts/

Diego wrote:

Hi,

Anyone can send me a code exaple to customize the Window
Title Bar?

I need to change the color and the Control Buttons.

Thanks in advance.

Diego

Nov 13 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
"James C. Li" wrote:

why implement icloneable which seems to involve writing
public object Clone()
{
return this;
}

Nov 13 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.