Buy Questpond's video subscriptions on
huge discount
.
Online: 1429
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 28
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 ...
How to create an object without invoking constructor in c#.net?
FormatterServices.GetUninitializedObject(Type)
is a method through which we can creates a new instance of the specified object type without invoking constructor. Even if the constructor is declared as private we can able to create object outside of the class. Because the new instance of the object is initialized to zero and no constructors are run.
Note: You cannot use the GetUninitializedObject method to create instances of types that derive from the ContextBoundObject class.
What are the major differences between C# and Java?
1)C# being a .NET language, supports language interoperability.This is not possible in Java.
2) The code written in C#, on compilation generates an ‘.exe’ or ‘.dll’ file which is also called Portable Executable file. These files contain MSIL (Microsoft Intermediate Language) code. As against this, the Java code on compilation generates a ‘.class’ file, which contains bytecode.
3)The portable executable file of C# can contain any number of classes, whereas, the ‘.class’ file in Java contains only one class.
4)The methods in C# are not virtual by default. On the contrary, methods in Java are virtual by default, which degrades the performance.
5)The classes in C# are grouped in Namespaces, whereas, classes in Java are grouped in Packages.
Which of the following statements is correct about the C#.NET code snippet given below? switch (id) { case 6: grp = "Grp B"; break; case 13: grp = "Grp D"; break; case 1: grp = "Grp A"; break; case ls > 20: grp = "Grp E"; break ; case Else: grp = "Grp F"; break; }
NOTE: This is objective type question, Please click question title for correct answer.
What makes a class abstract?
NOTE: This is objective type question, Please click question title for correct answer.
How to check if all array elements are strictly positive?
If you want to check whether everything is strictly positive, use:
bool allPositive = array.All(x => x > 0);
How to check if all array elements are non-negative?
If we actually want to check they're all non-negative (i.e. 0 is acceptable) use:
bool allNonNegative = array.All(x => x >= 0);
can one dll contain the compiled code of more than one programming language?
NOTE: This is objective type question, Please click question title for correct answer.
How to assign Multi Line String ?
You can use the @ symbol in front of a string
string str = @"Hello,
How are you
man";
What is difference between is and as operators in c#?
“is” operator is used to check the compatibility of an object with a given type and it returns the result as Boolean.
“as” operator is used for casting of object to a type or a class.
What is used in conversion where the conversion is defined between the expression and the type.
NOTE: This is objective type question, Please click question title for correct answer.
What is sealed Modifier
NOTE: This is objective type question, Please click question title for correct answer.
In c#, the attribute’s information for a Class can be retrieved at
NOTE: This is objective type question, Please click question title for correct answer.
What is inheritance hierarchy?
1. The class which derives functionality from a base class is called a derived class.
2. A derived class can also act as a base class for another class.
3. Thus it is possible to create a tree-like structure that illustrates the relationship between all related classes.
4. This structure is known as the inheritance hierarchy.
You need to write a multicast delegate that accepts a DateTime argument which code type you can choose
NOTE: This is objective type question, Please click question title for correct answer.
You need to create a method to clear a Queue named q.
NOTE: This is objective type question, Please click question title for correct answer.
Your application uses two threads, named threadOne and threadTwo. You need to modify the code to prevent the execution of threadOne until threadTwo completes execution. What should you do?
NOTE: This is objective type question, Please click question title for correct answer.
You have an application that is used by international clients. All clients connect by using Windows Authentication. You need to ensure that system and user-defined error messages are displayed in the localized language for the clients.
NOTE: This is objective type question, Please click question title for correct answer.
You have created an assembly that utilizes unmanaged code to access external resources. You need to deploy the assembly with the appropriate permissions. Which permission set should you use?
NOTE: This is objective type question, Please click question title for correct answer.
you need to identify Is Always a number Is Always greater than a 65,535
NOTE: This is objective type question, Please click question title for correct answer.
Can we have Return Statement in Finally Block?
No,we can not write any Return Statement inside Finally Block.It will throw an error at the Complie-Time saying that:-
"Control cannot leave the body of a finally clause"
Meaning that finally block is only used for Releasing Objects or Calling any function other than Returning Some Value.
1
...
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
...
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