Is Operator in C# with Example

From inheritance, we know that a base class always contains most of the common features and we also know a base class reference variable can point to the derived class object, but vice versa is not possible because a derived class is an extended version of a base class and it contains more functionally than

Sealed Class in C# with Example

If you want to prevent any class to be used as a base class in inheritance chain, you can mark that class sealed using sealed keyword.  Sealed class is normally a last class in the inheritance chain.  A sealed class can inherit from other class or interface, but other classes cannot inherit from it.  Apart

Using Keyword in C# with Example

We have seen how classes like StreamReader and StreamWriter work.  Both the classes contain a method called Close(), which we must call after finishing our job to release any system related resources associated with them.  In both classes, there is one another method called Dispose().  This method completely destroys the object from the memory.  When

StreamWriter Class in C# with Example

StreamWriter class is used for writing directly to the text files.  Like StreamReader class, it also resides in System.IO namespace and you must also include the same on top of your code file.  While creating an instance of StreamWriter class, you can directly pass the path of the text file to the constructor.  If the

StreamReader Class in C# with Example

StreamReader class is basically used for reading text files.  StreamReader class resides in System.IO namespace.  If you want to make use of StreamReader class, then you must include System.IO namespace by making use of using keyword on top of your code.  StreamReader class got various methods like ReadLine(), ReadToEnd(), etc. Upon creating an instance of