Buy Questpond's video subscriptions on
huge discount
.
Online: 12287
Home
Articles
Interviews
Forums
For Beginners
Popular Questions
ITIL Career Advice
PMP Career Advice
Career Advices
Codes
Videos
ASP.NET
ASP.NET MVC
Android Intel XDK
Sql Server
AngularJS
Bootstrap
Backbone.JS
MongoDB
LESS (CSS)
jQuery
WPF
WWF
SSIS
LightSwitch
Tutorials
News
ASP.NET MVC
|
Be Interview Ready
|
Top Performers
|
DNF MVP
|
Top Posts
|
Winners
|
Subscribe
|
Catalogs
Welcome Guest !
Register
Login
Home
>
Interviews
> C#
C# Interview Questions and Answers (958) - Page 45
Latest and authentic Interview questions. You can also
post an interview question
and
win monthly prizes
as well as gain community
credit points
.
958 records found.
Post
|
Interview Experiences
|
Interview FAQs
|
Online Interviews
|
Exclusive Questions
Get 650+ Questpond's Interview videos on discount
Loading ...
What will be the output of the below code segment? class Program { static void Main(string[] args) { Console.Write(string.Join("", "http://www.dotnetfunda.com/articles/show/3165/calculator-application-using-ironjs-and-wpf-by-invoking-an-external-ja".ToCharArray().Where(Char.IsDigit))); Console.ReadKey(true); } }
NOTE: This is objective type question, Please click question title for correct answer.
What will be the output of the below code segment? class Program { static void Main(string[] args) { Console.Write(string.Join(" ", "hello/3165/world".ToCharArray().Where(Char.IsLetter))); Console.ReadKey(true); } }
NOTE: This is objective type question, Please click question title for correct answer.
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 will be the output of bool containsApp = "hati,ghor,apple,mango,babai".Split(',') .Where(s => string.Compare("app", s, true) == 0) .Count() > 0;
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.
Consider the below class OuterClass { public void SayHelloFromOuterClass() { Console.WriteLine("Hello from Outer Class"); } public class InnerClass { public void SayHelloFromInnerClass() { Console.WriteLine("Hello from Inner Class"); } } } How to invoke SayHelloFromInnerClass() method?
NOTE: This is objective type question, Please click question title for correct answer.
What is the below piece of code performing namespace ConsoleApplication1 { public sealed class Singleton { private static Singleton instance = null; private static readonly object lockObj = new object(); Singleton(){} //private constructor public static Singleton Instance { get { lock (lockObj) { if (System.Object.ReferenceEquals(instance, null)) { instance = Inner.Instance; } return instance; } } } class Inner { Inner(){ }//private constructor public static Singleton Instance { get { return new Singleton(); } } } } }
NOTE: This is objective type question, Please click question title for correct answer.
What will be output of below code? public class MyClass { public void Test() { try { Console.WriteLine("Test"); } catch (Exception ex) { Console.WriteLine("Caught General Exception"); } catch (IndexOutOfRangeException ex) { Console.WriteLine("Caught IO Exception"); } } } Will this code compile?
NOTE: This is objective type question, Please click question title for correct answer.
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.
What will be output of following program? public class Base { public Base() { Console.WriteLine("Base"); } } public class Derived : Base { public Derived() { Console.WriteLine("Derived"); } } Public Class Main { static void Main(string[] args) { Derived obj=new Derived() } }
NOTE: This is objective type question, Please click question title for correct answer.
What will be output of following program? public class Base { public Base() { Console.WriteLine("Base"); } public Base(string name) { Console.WriteLine("Base: " + name); } } public class Derived : Base { public Derived() { Console.WriteLine("Derived"); } public Derived(string s) { Console.WriteLine("Derived: " + s); } } class Program { static void Main(string[] args) { Derived d = new Derived("rajesh"); Console.ReadLine(); } }
NOTE: This is objective type question, Please click question title for correct answer.
What will be output of following program? interface IInterface1 { void Show(); } interface IInterface2 { void Show(); } class A : IInterface1, IInterface2 { public void Show() { throw new NotImplementedException(); } }
NOTE: This is objective type question, Please click question title for correct answer.
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.
You have recently developed a Class named “ShopList”. The class is having Public properties Name, ID, Discount. You need to enable the users of the class to iterate through the ShopList collections. Which of the following code snippet will you use
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.
1
...
38
39
40
41
42
43
44
45
46
47
48
More C# Exclusive Interview Questions & Answers here
Found this useful, bookmark this page to the blog or social networking websites.
Bookmark It
Interview Questions and Answers Categories
.NET Certifications
.NET Core
.NET Framework
ADO.NET
AI ML
Android
Angular
AngularJS 1x
Aptitute Test
ASP.NET
ASP.NET AJAX
ASP.NET Core
ASP.NET MVC
ASP.NET Web API
Aurelia
Azure
Best Practices
BizTalk Server
Bootstrap
C#
Cloud
CMS
CSS 3
Data Structures & Algorithms
Design Pattern & Practices
DotNetFunda.Com
Entity Framework
Error and Solution
F#
Function Points (FPA)
HR
HTML 5
IIS
Interview Questions
JavaScript
jQuery
Kinect
LightSwitch
LINQ
Management
Mobile Development
MSBI (SSIS, SSRS, SSAS)
Mule
Networking
News and Community
Node.js
NoSql
OOPS
Oracle
Others
PostgreSQL
PowerShell
Product Reviews
Project Management
Python
QA (Testing)
R Language
Regular Expressions
SEO
SharePoint
SignalR
Silverlight
Sql Server
TypeScript
UML
VB.NET
Visual Studio
WCF
Web Analytics
Web Services, Remoting
Windows 8
Windows Forms
Windows Metro
Windows Phone
WPF
WWF
XML