1. Var and/vs Dynamic With Var keyword properties / Methods /Operators etc are resolve at compile time. Var keyword is static typed and type cannot be change,Once you have assigned the type to var. var i = “abc”; i = 1 ; //you cannot assign it integer value once it has been marked as string … Continue reading
Tagged with C# interview questions …
What are Func, Predicate, Action delegates with Examples ? #AspNetInterviewQuestionsSeries
To learn Delegate you guys can refer my previous article. In this article we will learn about what are Func, Predicate and Action Delegate. Keeping the power of delegates in the mind .Net Framework has introduced the predefined delegates which can be useful for a developer. .Net Framework has also used these predefined delegates at … Continue reading
What are Delegates ? When and why we should use Delegates in C# with example ? #AspNetInterviewQuestionsSeries
Delegates : Delegate word in English defines that entrust (a task or responsibility) to another person.Same concept is follows in C# with some additional properties. Delegates Overview : Delegates have the following properties: Delegates are similar to C++ function pointers, but are type safe. Delegates allow methods to be passed as parameters. Delegates can be used … Continue reading
How to acess INTERNAL types and members into another assembly ? #AspNetInterviewQuestionsSeries
Lets learn about INTERNAL keyword in C#. Basically INTERNAL keyword is an access modifier which ensures that types and members within the same assembly. But is there any way we can access the INTERNAL type and members from another assembly? yeah there is actually. We can use the INTERNALVISIBLETO keyword into assmeblyinfo.cs or onto the class at namespace level using System.Runtime.CompilerServices. Lets Code : … Continue reading
How you can limit a class to create only two instances ?
How you can limit a class to create only two(n) instances ? This is one of my favorite question in an interview.So before watching the answer take a minute and think how you can create a such class .. tough ? Ahan its very easy. Answer : The basic idea is create a static property and … Continue reading