Skip to Main Content
Programming C#
book

Programming C#

by Jesse Liberty
July 2001
Intermediate to advanced content levelIntermediate to advanced
688 pages
16h 14m
English
O'Reilly Media, Inc.
Content preview from Programming C#

Supporting Other .NET Languages

C# provides the ability to overload operators for your classes, even though this is not, strictly speaking, in the Common Language Specification (CLS). Other .NET languages, such as VB.NET might not support operator overloading, and it is important to ensure that your class supports alternative methods that these other languages might call to create the same effect.

Thus, if you overload the addition operator (+) you might also want to provide an add( ) method that does the same work. Operator overloading ought to be a syntactic shortcut, not the only path for your objects to accomplish a given task.

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Programming C#, Second Edition

Programming C#, Second Edition

Jesse Liberty
Programming C# 12

Programming C# 12

Ian Griffiths
Programming C# 8.0

Programming C# 8.0

Ian Griffiths

Publisher Resources

ISBN: 0596001177Supplemental ContentCatalog PageErrata