Wednesday, June 27, 2012

C# Static Methods


Static methods have no instances. They are called with the type name, not an instance identifier i.e we have no need to create the instance of class to call the static methods.So they are slightly faster than instance methods.
The static methods use the static keyword somewhere in the method declaration signature, usually as the first keyword or the second keyword after public

Wednesday, June 13, 2012

Extension Methods in C#

In this post, we will take a look at what extension methods are and how to use them in C#. Extension methods are one of the best things that have been introduced in .Net framework in terms of readability. Extension methods are available from .Net framework 3.5.

Monday, June 11, 2012

Partial Classes and Methods

Partial Classes and Methods

C# 2.0 introduced partial types to allow class definitions to be split between several files. C# 3.0 extends the concept with partial methods, allowing method signatures to be declared but not implemented. This is ideal for use with code generation tools.
In this post , I will try to explain the basic rules of partial classes and methods and how simple it is to use partial methods.

Wednesday, May 30, 2012

Sealed Classes and Methods

Sealed Classes

Sealed Classes are those classes that cannot be inherited by other classes. If we want to prevent a class to be inherited by other class then we make that class as Sealed Class. To create a class as sealed class, create the class using the keyword sealed.

Syntax:-

[Access Modifier] sealed class classname
{
//Class Body
}

Tuesday, May 29, 2012

Serialization in C#

Serialization in C#

Serialization is the process of converting an object into stream of bytes in order to persist it to memory, a database or a file. Its main purpose is to save the state of an object for the later uses when needed. The reverse process is call deserialization.

^ Scroll to Top