Author Archives: compitionpoint - Page 27
Operator Overloading
Operator overloading allows you to customize the behaviors of C# operators depending on the type of its operands. Operator overloading allows a C# operator to interpret objects in a different way.…
Containment
Containment or composition is the process of adding another class as a member of a class. For example, a Person class can have a field of type Name. The program below shows an example…
Boxing and Unboxing
Boxing is the process of converting a value type such as a structure into an object or a reference ;Unboxing is the opposite the opposite process and converts reference types to value…
System.Object Class
All classes in the .NET Framework inherits from the ;class. The ;class is mapped to the object keyword in C#. For simplicity, I will just use object to refer to The following is a list of…
Virtual Methods
Virtual methods are methods of a base class that can be overridden by a method in a derived class to provide a different implementation of that method. For example, you have…
Static Members
The static keyword is used on members and properties that want to be shared by all instance of the class. When a method or property is defined as static, you can call them…
protected Access Specifier
The protected access specifier allows class members to be accessed only by those who inherits from them. We learned about the public and private access specifiers. The protected access specifier is used when only the derived classes and…
Class Libraries
You can create a Class Libraries which is a collection of classes and other codes that can be compiled and redistributed for software reusability. Class libraries are compiled into dynamic link…
Structures Versus Classes
So what’s the difference between a class and a structure? Structures are value types like int, double, and string. When you copy a value of structures to other variables, it copies its values…
Namespaces
Using a namespace is a way of packaging your application codes such as classes into a uniquely named structure. Everything in .NET Framework is wrap inside at least one namespace. When…