Automation Demo
...
Duration
20 hoursCourse Price
$ 399.004.5 (23)
C# is a type- safe, object oriented, modern, general-purpose, programming language developed by Microsoft.
C# is designed for Common Language Infrastructure (CLI), which consists of the executable code and runtime environment.
It allows use of various high-level languages on different computer platforms and architectures.
C# provides the rapid application development found in Visual Basic with the power of C++.
The advantages of C# are as follows:
· It is Easy to learn
· It is Object oriented
· It is Component oriented
· It is Part of .NET framework
Below are some of the features supported in C# -
· Constructors and Destructors
· Properties
· Passing Parameters
· Arrays
· Main
· XML Documentation and
· Indexers
The types of comments in C# are -
· Single Line Comment Eg : //
· Multiline Comments Eg: /* */
· XML Comments Eg : ///
Below are the types of errors in C# -
· Compile Time Error
· Run Time Error
Inner exception in C# is a property of exception class which will give you a brief insight of the exception i.e, parent exception and child exception details.
Below are some of the exceptions in C# -
· NullReferenceException
· ArgumentNullException
· DivideByZeroException
· IndexOutOfRangeException
· InvalidOperationException
· StackOverflowException etc.
Hashtable is used to store the key/value pairs based on hash code of the key. Key will be used to access the element in the collection. For example,
Hashtable myHashtbl = new Hashtable();
myHashtbl.Add("1", "TestValue1");
myHashtbl.Add("2", "TestValue2");
A Jagged array is an array of arrays.
You can initialize a jagged array as −
int[][] scores = new int[2][]{new int[]{92,93,94},new int[]{85,66,87,88}};
Where, scores is an array of two arrays of integers - scores[0] is an array of 3 integers and scores[1] is an array of 4 integers.
One can store any type of value in the dynamic data type variable. Type checking for these types of variables takes place at run-time.
Syntax for declaring a dynamic type is −
As operator casts without raising an exception if the cast fails.
Object obj = new StringReader("Hello");
A class can be derived from more than one class or interface, which means that it can inherit data and functions from multiple base classes or interfaces. The syntax used in C# for creating derived classes is as follows −
{
...
}
class
{
...
}
A namespace is designed for providing a way to keep one set of names separate from another. So that the class names declared in one namespace does not conflict with the same class names declared in another.
C# delegates are same as pointers to functions, in C or C++. A delegate Object is a reference type variable that use to holds the reference to a method. The reference can be changed at runtime which is hold by an object of delegate, a delegate object can hold many functions reference which is also known as Invocation List that refers functions in a sequence FIFO, we can new functions ref in this list at run time by += operator and can remove by -= operator.
Delegates are especially used for implementing events and the call-back methods. All delegates are implicitly derived from the System.Delegate class.
Anonymous types allow one to create a new type without defining them. This is way to defining read only properties into a single object without having to define type explicitly. Here Type is generating by the compiler and it is accessible only for the current block of code. The type of properties is also inferred by the compiler.
Consider:
var anonymousData = new
13)What do you mean by namespace in C#?
14)What is delegates in C# and uses of delegates?
15)Explain Anonymous type in C?