Tag Archives: property

Operator overloading in C#

C# allows you to overload certain operators. The figure below shows a table of overloadable operators. Suppose there is a BankAccount class which contains a Number property and a Balance property. The + (addition) operator can be overloaded to combine two BankAccount instances and to return a new BankAccount instance with the combined balances. This [...]

Posted in C# | Also tagged , , , , , , , , | Leave a comment

State design pattern in C#

The state pattern is a software design pattern to represent the state of an object. It allows an object to alter its behavior when its state changes. It shows a similarity to the strategy pattern.

Posted in C# | Also tagged , , , , , , , , , , , , | Leave a comment

Constructor overloading in C#

C# allows you to reuse existing constructors when defining new constructors.

Posted in C# | Also tagged , , , | Leave a comment