C# Interview Questions and Answers (958) - Page 45

What will be the output of var result = Regex.Match("hati,ghora,apple,mango,babai", @"\bapple\b").Success; ?

NOTE: This is objective type question, Please click question title for correct answer.
What is the purpose of the Group Class in C#?

NOTE: This is objective type question, Please click question title for correct answer.
What is the purpose of Captures property of Group Class in C#?

NOTE: This is objective type question, Please click question title for correct answer.
What is String Interpolation?

C# 6.0 comes with a unique feature where the String Interpolation happens in between the strings.Rather than placing the positional placeholders in the old ways, we can use the real values like the way we have used the real properties inside the string braces. String Interpolation is a trick made by the compiler to invoke the string.Format function.
What is the difference between throw and throw ex?

Throw does not clear the stack trace so all the classes from where the exception originated will appear in inner exception and stack trace. When we throw an exception by using throw ex, the stack trace is cleared,
and only the last exception is visible.
What is marshaling and what is use of it?

Marshaling is process of converting unmanaged data type to managed data type.
Let suppose you are using unmanaged code. Data type is different in different languages.
For example int data type in C# is Int32 and it is 32 bit.
But windows API has INT as integer data type. when we marshal Int32 to INT then we just change the type not data.
Why multiple inheritance is not possible in c#?

This is Cause by diamond Shape problems of two classes. If two classes B and C inherit from A, and class D inherits from both B and C. If a method in D calls a method defined in A (and does not override it), and B and C have overridden that method differently, then via which class does it inherit: B, or C? It creates ambiguity and Simply, it will increase the complexity. So., multiple inheritance is not possible in C#. that is called Diamond Problem. But., in C# we can solve the Diamond problem with the help of interfaces in some cases.
What is the difference between Dispose() and Finalize() methods?

NOTE: This is objective type question, Please click question title for correct answer.
When you create a thread, it is by default which type of thread?

NOTE: This is objective type question, Please click question title for correct answer.
How many types of threads are defined by .NET Framework?

NOTE: This is objective type question, Please click question title for correct answer.
Found this useful, bookmark this page to the blog or social networking websites. Page copy protected against web site content infringement by Copyscape

 Interview Questions and Answers Categories