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

Nizamuddin Siddiqui
Published on 05-Aug-2020 13:28:06
C# interface members can be implemented explicitly or implicitly.Implicit implementations don't include the name of the interface being implemented before the member name, so the compiler infers this. The members will be exposed as public and will be accessible when the object is cast as the concrete type.The call of ... Read More

How to use order by, group by in c#?

Nizamuddin Siddiqui
Published on 05-Aug-2020 12:29:09
Order by is used to sort the arrays in the ascending or in the descending orderGroupBy operator belong to Grouping Operators category. This operator takes a flat sequence of items, organize that sequence into groups (IGrouping<K, V>) based on a specific key and return groups of sequenceExampleclass ElectronicGoods {   ... Read More

How to subscribe to an Event in C# and can we have multiple subscribers to one Event in a C#?

Nizamuddin Siddiqui
Published on 05-Aug-2020 12:21:51
Events enable a class or object to notify other classes or objects when something of interest occurs.The class that raises the event is called the publisher and the classes that handle the event are called subscribers.In the EventAn event can have multiple subscribers. A subscriber can handle multiple events from ... Read More

What is #if DEBUG and How to use it in C#?

Nizamuddin Siddiqui
Published on 05-Aug-2020 12:18:08
In Visual Studio Debug mode and Release mode are different configurations for building your .Net project.Select the Debug mode for debugging step by step their .Net project and select the Release mode for the final build of Assembly file (.dll or .exe).The Debug mode does not optimize the binary it ... Read More

What is bin and obj folder in C#?

Nizamuddin Siddiqui
Published on 05-Aug-2020 12:15:43
Whenever we write a C# code and build or run the solution it generates 2 folders −binobjThese bins and obj has the compiled codeWhy do we have 2 folders?The reason is the compilation process goes through 2 stepscompilinglinkingIn the compiling every individual file is compiled into individual unitsThese compiled files ... Read More

What is the difference between IEnumerable and IQueryable in C#?

Nizamuddin Siddiqui
Published on 05-Aug-2020 12:12:34
IEnumerable exists in System.Collections Namespace.IQueryable exists in System. Linq Namespace.Both IEnumerable and IQueryable are forward collection.IEnumerable doesn’t support lazy loadingIQueryable support lazy loadingQuerying data from a database, IEnumerable execute a select query on the server side, load data in-memory on a client-side and then filter data.Querying data from a database, ... Read More

What is Binary Serialization and Deserialization in C# and how to achieve Binary Serialization in C#?

Nizamuddin Siddiqui
Published on 05-Aug-2020 11:57:32
Converting an Object to a Binary format which is not in a human readable format is called Binary Serialization.Converting back the binary format to human readable format is called deserialization?To achieve binary serialization in C# we have to make use of library System.Runtime.Serialization.Formatters.Binary AssemblyCreate an object of BinaryFormatter class and ... Read More

Sum of first N natural numbers which are divisible by 2 and 7 in C++

sudhir sharma
Published on 05-Aug-2020 11:49:30
In this problem, we are given a number N. Our task is to find the sum of first N natural numbers which are divisible by 2 and 7.So, here we will be given a number N, the program will find the sum of numbers between 1 to N that is ... Read More

Sum of subset differences in C++

sudhir sharma
Published on 05-Aug-2020 11:48:15
In this problem, we are given a set S of n number. Our task is to create a program to find the sum of subset difference which is the difference of last and first elements of subset.The formula is, sumSubsetDifference = Σ [last(s) - first(s)] s are subsets of the ... Read More

Sum of similarities of string with all of its suffixes in C++

sudhir sharma
Published on 05-Aug-2020 11:46:39
In this problem, we are given string str. Our task is to create a program to find the sum of similarities of the string with all of its suffixes.Suffixes of string str are all the strings that are created by eliminating starting characters of the string.Similarities of string str1 and ... Read More
1 2 3 4 5 6 7 ... 3775 Next
Advertisements