Why does a private implementation of ICloneable work?

C

cmay

Can someone explain why you can implement ICloneable with a private
function and it works?

e.g.

Imports System
Public Class BusinessObject
Implements ICloneable

Private Function privateClone() As Object Implements
ICloneable.Clone
Dim MyClone As Object = makeClone()
Return MyClone
End Function

End Class

Does that fact that the Clone is public on ICloneable mean that the
"private" above is ignored when the object is being dealt with as type
ICloneable?
 
A

Alvin Bruney - ASP.NET MVP

The modify tag, private, does not apply to the compiler. It is capable of
calling the method. The tag is applicable only to calling code.

--
Warm Regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
The Microsoft Office Web Components Black Book with .NET
Now Available @ www.lulu.com/owc
Professional VSTO 2005 - Wrox/Wiley 2006
Blog: http://msmvps.com/blogs/Alvin/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top