Func, Action & Predicate – Generic Delegates

Introduction In an earlier post, we have discussed delegates, multicast delegate. In this article, I am going to discuss the Generic Delegates in C#. In .NET Framework 3.5, C# introduces Generic delegate which allows to invoke the delegates without defining the delegate instance. To understand the Generic Delegates, we should have the basic knowledge of Delegates. I would recommend checking earlier posts related to delegates, … Continue reading Func, Action & Predicate – Generic Delegates

Delegates Interview Questions

Collection of typically Interview Questions on delegates for interview preparation. you can also read more about delegates, callbacks, and Multicast Delegates. Alternatively, you can also test your knowledge by an online free quiz for delegates and multicast delegate. Interview question: What is a delegate? Answer: A delegate is a type-safe function pointer. Using delegates you can pass methods as parameters. To pass a method as … Continue reading Delegates Interview Questions

Multicast Delegates Interview Questions

Collection of typically Interview Questions on Multicast delegates for interview preparation. you can also read more about delegates, callbacks, Multicast Delegates, Generic Delegates. Alternatively, you can also test your knowledge by an online free quiz for delegates, multicast delegate, generic delegates. Interview Question: What is Multicast delegate/ chaining delegates? Answer: The capability of calling multiple methods on a single event is called as Multicast delegate or chaining delegates, Multicast delegates can be … Continue reading Multicast Delegates Interview Questions


Introduction When a head of state dies, the President of the United States typically does not have time to attend the funeral personally. Instead, he dispatches a delegate. Often this delegate is the Vice President, but sometimes the VP is unavailable, and the President must send someone else, such as the Secretary of State or even the First Lady. He does not want to “hardwire” … Continue reading Delegates

Extension Methods

Introduction Extension Methods allow user to add additional feature or methods to existing class without creating a new derived type. Before diving into extension method, lets understand why we use extension method in c#? Example Suppose that there is a class with n number of methods, and you want to add more methods into it. you can add Extension methods using below two approach: You … Continue reading Extension Methods

Exception Handling in C# – Part II

Introduction In the previous post, we have covered basics of exception handling, the purpose of exception handling, types of error, list of system exceptions, and some examples of run time error. In this post will cover ways to handle the exceptions in C#, multiple exceptions catches and writing custom exceptions below is the index: How to handle Exception in C# C# provides built-in support to … Continue reading Exception Handling in C# – Part II

Interview Questions: Multiple Catch Block in C#

Introduction In C#, You can use more than one catch block with the try block to handle different types of exceptions means each catch block is used to handle different types of exceptions. For example: Below example, we have added multiple catch block, so let say if the user has entered string value in first input then control will be passed to the FormatException catch … Continue reading Interview Questions: Multiple Catch Block in C#

Exception Handling in C# – Part I

Introduction Exception handling is handling known or unknown errors from the program. So, when any error occurs then the program should recover gracefully from the error. In computing and computer programming, exception handling is the process of responding to the occurrence of exceptions – anomalous or exceptional conditions requiring special processing – during the execution of a program. Wiki The basic purpose of exception handling … Continue reading Exception Handling in C# – Part I

thread.sleep, thread.sleep in c#,thread.sleep in c# console application, thread.sleep in c# windows application, thread.sleep in c# not working

Why you should avoid Thread.Sleep

Introduction Thread.Sleep allows user to hold or suspend or block the current thread execution till a predefined time. it is implemented in System.Threading.Thread.dll assembly. It has two overload method C# Source code to demonstrate thread sleep Why you should avoid Thread.Sleep Thread.Sleep required hardcoded sleep time value, which is not a good idea at all. In multithread applications, handling a race condition using Thread.Sleep is … Continue reading Why you should avoid Thread.Sleep

Passing by Value vs. Passing by Reference 

In earlier post we have seen how value type and reference type variable instances behave differently when create copied variable and changing copied variable values. Pass by value Pass by value means you are making a copy in memory of the actual parameter’s value that is passed in, a copy of the contents of the actual parameter. Use pass by value when you are only … Continue reading Passing by Value vs. Passing by Reference 

Jenkins – Continuous Deployment of .NET Projects with Git Hub

Jenkins is free and open source automation server. It helps to automate tasks related to building, testing and delivering/deploying the software. Jenkins backed by powerful plugins to integrate with source control management software like GitHub and can be setup to automatically get the source code form GitHub repository, build it and autonomously. Procedure to setup Jenkins to build and deploy .NET Projects. This tutorial divided … Continue reading Jenkins – Continuous Deployment of .NET Projects with Git Hub

Why we need Continues Deployment?

Continuous Deployment (CD) is an autonomous release process that uses automated testing to validate changes for instant auto deployment to a production environment. As good software practice, developer often break big task into small piece for smooth development and integration in other side it’s also good for end user to grasp the small changes. But releasing software frequently is not easy task. Frequent release come … Continue reading Why we need Continues Deployment?

Array vs ArrayList

Array: An array is a collection of similar data types that can be accessed by index. Array allocates then static memory with consecutive section of memory blocks. ArrayList: ArrayList is a collection of objects of same or different types. ArrayList size can be dynamically increased or decreased as per the requirement. Here is difference table of Array vs ArrayList Array ArrayList Array stores a fixed number of elements. ArrayList is dynamic … Continue reading Array vs ArrayList

Access Specifiers in C#

Introduction Access Specifiers are the keywords that specify accessibility of the object. In other words, access Specifiers define the scope of the user-defined type and its members, i.e. we define who can access the class and its members. As this topic needs at least some basic understanding about object-oriented concepts, so before going through this post you must visit the object-oriented concepts C# provides us … Continue reading Access Specifiers in C#

Control structures

Introduction C# Uses control structures are like flow controller based on the condition it controls the flow of a program. In other words, a control structure determines the order in which the program is executed. Control structure can be put in the following categories: Conditional structures – Conditional structures allow the program to choose different paths of execution based upon the outcome of an expression … Continue reading Control structures

Program Structure

Introduction In previous post we have seen how to create a console application, in fact we have written small “Hello” program. So before moving further let’s understand minimum C# program structure. For reference will take same “Hello” example from previous post.  Here is source code: If we see above example, we can divide the above program into 4 parts using directive Namespaces Class Main method … Continue reading Program Structure

Basic of C#

Introduction First things first, just as we use a language to communicate with each other, like English, Hindi, etc. we have to use a language to communicate with computers also. By communicating, what I mean is that if we have to tell the computer to do something, we need to use a language, Any computer language has some keywords and predefined syntax which we need … Continue reading Basic of C#

Bitwise Operator’s

Introduction Bitwise Operators always scared developers (with no offence) but once developers understood the power of it, developers love them. Bitwise operator are very powerful operators if understood correctly. Its operators on ints and uints at the binary level. This means they look directly at the binary digits or bits of an integer.  Types of Bitwise Operator Bitwise AND (a & b) Bitwise AND is like logical AND in … Continue reading Bitwise Operator’s

Get Started with C# -II

In earlier post we talk about C# & visual studio installation. Hopefully, you have installed the visual studio on your machine. Let’s create a first console application For making a console application in Visual Studio by using C# as the programming language, perform the following steps (These steps are for Visual Studio 2017 professional version. For other versions, these steps might differ) : Open Visual … Continue reading Get Started with C# -II

Visual Studio Installation Failed – Recovery

Generally, the standard install procedure work as expected, if you face any issue you can click on the “Repair” option but The Repair option appears only for installed instances of Visual Studio. Repairing Visual Studio will reset the environment. Local customizations like per-user extensions installed without elevation, user settings, and profiles will be removed. Your synchronized settings such as themes, colors, key bindings will be … Continue reading Visual Studio Installation Failed – Recovery