In this article, you will learn about the usage of various exception handling statements in C# with the help of relevant listings. Trapping and handling of runtime errors is one of the most crucial tasks ahead of any programmer. But, before discussing runtime errors, let's look at compile time errors, which are errors that occur during compilation time. They may be due to bad coding, misspelling of syntaxes, and so on. They can be corrected by studying the error messages and warnings the compiler produces.
Actions and events serve an important part in every GUI-based application. These are equally important in the same way because we are arranging components using either Visual Studio .NET or by applying codes. It's these actions that instruct the program what to do when something happens.
In C#, arrays are derived from the System.Array class. There are lot of properties and methods in this class; we can manipulate these for our programming tasks. Arrays in C# are declared in the same fashion as in Java or C++; they can be either single- or multidimensional.
To rectify the drawback of multiple inheritance, the creators of C# have introduced a new concept called interfaces. Java programmers may be well aware of this concept. All interfaces should be declared with the keyword interface. You can implement any number of interfaces in a single derived class, but you should provide signatures to all method definitions of the corresponding interfaces.
Gradually, as you start picking up the threads of multi-threading, you would feel the need to manage shared resources. The .NET framework provides a number of classes and data types that you can use to control the access to shared resources.