Nizamuddin Siddiqui has Published 2303 Articles

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

19K+ 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

388 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

660 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

277 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

How many destructors can we have in one class in C#?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 04-Aug-2020 07:06:19

485 Views

In c#, Destructor is a special method of a class and it is used inside a class to destroy the object or instances of classes.There can be only one destructor inside a classFollowing are the properties of destructor in c#Destructors will not take any parametersDestructors will begin with a tilde ... Read More

What is the difference between Select and SelectMany in Linq C#?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

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

3K+ Views

Select operator produces one result value for every source SelectMany Operator belong to Projection Operators category. It is used to project each element of a sequence to an IEnumerable and flattens the resulting sequences into one sequence.Exampleclass Demo{    public string Name { get; set; }    public List Contents ... Read More

How to prove that only one instance of the object is created for static class?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

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

223 Views

Here in the example a static Demo class is created and a static variable count is declared.Here the count variable is treated as a global variable .so it keeps on increasing in the example ,because only one instance of the class is createdExamplestatic class Demo{    public static int count; ... Read More

Advertisements