Decision making statements help you to make decision based on certain conditions. These conditions are specified by a set of decision making statements having boolean expressions which are evaluated to a boolean value true or false. There are following types of decision making statements in C#.
Ref and out parameters are used to pass an argument within a method. In this article, you will learn the differences between these two parameters.
A delegate is a reference type that holds the reference of a class method. Any method which has the same signature as delegate can be assigned to delegate. It is very similar to the function pointer but with a difference that delegates are a type-safe. We can say that it is the object-oriented implementation of function pointers.
A collection is a set of related objects. Unlike arrays, a collection can grow and shrink dynamically as the number of objects added or deleted. A collection is a class, so you must declare a new collection before you can add elements to that collection.
C# is rich in data type. It provides three types Object, Var and Dynamic to store data of any type. In this article, I am trying to explore the differences among these three.
Errors refer to the mistake or faults which occur during program development or execution. If you don't find them and correct them, they cause a program to produce wrong results.
A Property acts as a wrapper around a field. It is used to assign and read the value from a field by using set and get accessors. The code block for the get accessor is executed when the property is read and the code block for the set accessor is executed when the property is assigned a new value. A property can be created for a public, private, protected and internal field.
The break, goto, continue, return and throw statements are known as jump statements. These are used to transfer program control from one point in the program to another point, at any time. Let's understand how these work?
C# most recent version 5.0 was released on August 15, 2012 with .NET Framework 4.5 and Visual Studio 2012. There are two main features in C# 5.0 - Async Programming and Caller Information. Let's understand both these features in details as given below.
Constant and ReadOnly keyword are used to make a field constant which value cannot be modified. Static keyword is used to make members static that can be shared by all the class objects. In this article, I am going to explain the difference among these three.
Abstract class is a special type of class which cannot be instantiated and acts as a base class for other classes. Abstract class members marked as abstract must be implemented by derived classes.
An interface acts as a contract between itself and any any class or struct which implements it. It means a class that implement an interface is bound to implements all its members. Interface has only member’s declaration or signature and implicitly every member of an interface is public and abstract.
Boxing and unboxing are the most important concepts you always get asked in your interviews. Actually, it's really easy to understand, and simply refers to the allocation of a value type (e.g. int, char, etc.) on the heap rather than the stack.
Type Casting or Type Conversion is a mechanism to convert one data type value to another one. Type conversion is possible if both the data types are compatible to each other; otherwise you will get an InvalidCastException.
As you know Polymorphism is the concepts of OOPS which includes method overriding and method overloading. Virtual and Override keyword are used for method overriding and new keyword is used for method hiding. Let's have look on these keywords in C# and try to understand each importance.