Nizamuddin Siddiqui has Published 2307 Articles

What are named parameters in C#?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 04-Aug-2020 07:27:58

3K+ Views

Named parameters provides us the relaxation to remember or to look up the order of parameters in the parameter lists of called methods. The parameter for each argument can be specified by parameter name.NamedParameterFunction(firstName: "Hello", lastName: "World")Using named parameters in C#, we can put any parameter in any sequence as ... Read More

What is the difference between Foreach and Parallel.Foreach in C#?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 04-Aug-2020 07:26:05

1K+ Views

Foreach loop in C# runs upon a single thread and processing takes place sequentially one by one. Whereas Parallel.Foreach loop in C# runs upon multiple threads and processing takes place in a parallel way. Which means it is looping through all items at once without waiting for the previous item ... Read More

How to make a method deprecated in C#?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 04-Aug-2020 07:23:31

4K+ Views

The Obsolete Attribute marks elements like classes, methods, properties, fields, delegates, and many others within our code as deprecated or obsolete. The attribute is read at compile time and it is used to generate a warning or an error to the developer.This attribute can help if we have ever wanted ... Read More

What is an Optional parameter in C#?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 04-Aug-2020 07:20:32

5K+ Views

By default, all parameters of a method are required. A method that contains optional parameters does not force to pass arguments at calling time. It means we call method without passing the arguments.The optional parameter contains a default value in function definition. If we do not pass optional argument value ... Read More

What is the difference between List and IList in C#?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 04-Aug-2020 07:17:15

15K+ Views

The main difference between List and IList in C# is that List is a class that represents a list of objects which can be accessed by index while IList is an interface that represents a collection of objects which can be accessed by index. The IList interface implemented from two ... Read More

What is the difference between Finalize and Dispose in C#?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 04-Aug-2020 07:15:02

3K+ Views

FinalizeFinalize() is called by the Garbage Collector before an object that is eligible for collection is reclaimed. Garbage collector will take the responsibility to deallocate the memory for the unreferenced object. The Garbage Collector calls this method at some point after there are no longer valid references to that object ... Read More

What is explicit implementation and when to use in the interface in C#?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 04-Aug-2020 07:12:33

274 Views

If a class implements two interfaces that contain a member with the same signature, then implementing that member on the class will cause both interfaces to use that member as their implementation.It's possible to implement an interface member explicitly—creating a class member that is only called through the interface, and ... Read More

What are union, intersect and except operators in Linq C#?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 04-Aug-2020 07:10:41

453 Views

UnionUnion combines multiple collections into a single collection and returns a resultant collection with unique elementsIntersectIntersect returns sequence elements which are common in both the input sequencesExceptExcept returns sequence elements from the first input sequence that are not present in the second input sequenceExampleclass Program{    static void Main(){   ... Read More

Which one is better Build, Rebuild, or Clean in C#?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 04-Aug-2020 07:09:04

167 Views

Build solutionThis will perform an incremental build. In other words it will only build code files which have changed.If they have not changed those files will not be touched. Compiles code files (DLL and EXE) which are changed.Rebuild solutionThis will delete all currently compiled files (i.e., exe and DLLs) and ... Read More

How to explicitly call base class constructor from child class in C#?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 04-Aug-2020 07:07:55

1K+ Views

Make use of this keyword in c# to call one constructor from another constructor To call a constructor which is present in parent class make use of base keywordExampleTo call a constructor which is present in another class make use of base keywordclass DemoBase{    public DemoBase(int firstNumber, int secondNumber, ... Read More

Advertisements