October 26, 2018

Srikaanth

Luxoft Most Frequently Asked Latest C# Interview Questions Answers

Can Multiple Catch Blocks Be Executed?

No, once the proper catch code fires off, the control is transferred to the finally block (if there are any), and then whatever follows the finally block.

How Do I Develop C# Apps?

The (free) .NET SDK contains the C# command-line compiler (csc.exe). Visual Studio has fully integrated support for C# development. On Linux you can use Mono.

Why Is It A Bad Idea To Throw Your Own Exceptions?

Well, if at that point you know that an error has occurred, then why not write the proper code to handle that error instead of passing a new Exception object to the catch block? Throwing your own exceptions signifies some design flaws in the project.

What's A Delegate?

A delegate object encapsulates a reference to a method. In C++ they were referred to as function pointers.

What's A Multicast Delegate?

It’s a delegate that points to and eventually fires off several methods.

How's The Dll Hell Problem Solved In .net?

Assembly versioning allows the application to specify not only the library it needs to run (which was available under Win32), but also the version of the assembly.

What Are The Ways To Deploy An Assembly?

An MSI installer, a CAB archive, and XCOPY command.

What's A Satellite Assembly?

When you write a multilingual or multi-cultural application in .NET, and want to distribute the core application separately from the localized modules, the localized assemblies that modify the core application are called satellite assemblies.

What's The Advantage Of Using System.text.stringbuilder Over System.string?

StringBuilder is more efficient in the cases, where a lot of manipulation is done to the text. Strings are im mutable, so each time it’s being operated on, a new instance is created.

Can You Store Multiple Data Types In System.array?

No.

What's The Difference Between The System.array.copyto() And System.array.clone()?

The first one performs a deep copy of the array, the second one is shallow.

How Can You Sort The Elements Of The Array In Descending Order?

By calling Sort() and then Reverse() methods.
Luxoft Most Frequently Asked Latest C# Interview Questions Answers
Luxoft Most Frequently Asked Latest C# Interview Questions Answers

What's The .net Datatype That Allows The Retrieval Of Data By A Unique Key?

HashTable.

What's Class Sortedlist Underneath?

A sorted HashTable.

Will Finally Block Get Executed If The Exception Had Not Occurred?

Yes.

What's The C# Equivalent Of C++ Catch (....), Which Was A Catch-all Statement For Any Possible Exception?

A catch block that catches the exception of type System.Exception. You can also omit the parameter data type in this case and just write catch {}.


What Namespaces Are Necessary To Create A Localized Application?

System.Globalization, System.Resources.

What's The Difference Between // Comments, /* */ Comments And /// Comments?

Single-line, multi-line and XML documentation comments.

How Do You Generate Documentation From The C# File Commented Properly With A Command-line Compiler?

Compile it with a /doc switch.

What's The Difference Between <c> And <code> Xml Documentation Tag?

Single line code example and multiple-line code example.

What Does Dispose Method Do With The Connection Object?

Deletes it from the memory.

What Is A Pre-requisite For Connection Pooling?

Multiple processes must agree that they will share the same connection, where every parameter is the same, including the security settings.

Does C# Replace C++?

There are three options open to the Windows developer from a C++ background

•Stick with standard C++. Don't use .NET at all.
•Use C++ with .NET. Microsoft supply a .NET C++ compiler that produces IL rather than machine code. However to make full use of the .NET environment (e.g. garbage collection), a set of extensions are required to standard C++. In .NET 1.x this extended language is called Managed Extensions for C++. In .NET 2.0 ME C++ has been completely redesigned under the stewardship of Stan Lippman, and renamed C++/CLI.
•Forget C++ and use C#.

Each of these options has merits, depending on the developer and the application. For my own part, I intend to use C# where possible, falling back to C++ only where necessary. ME C++ (soon to be C++/CLI) is very useful for interop between new .NET code and old C++ code - simply write a managed wrapper class using ME C++, then use the managed class from C#. From experience, this works well.

Does C# Have Its Own Class Library?

Not exactly. The .NET Framework has a comprehensive class library, which C# can make use of. C# does not have its own class library.

What Standard Types Does C# Use?

C# supports a very similar range of basic types to C++, including int, long, float, double, char, string, arrays, structs and classes. However, don't assume too much. The names may be familiar, but many of the details are different. For example, a long is 64 bits in C#, whereas in C++ the size of a long depends on the platform (typically 32 bits on a 32-bit platform, 64 bits on a 64-bit platform). Also classes and structs are almost the same in C++ - this is not true for C#. Finally, chars and strings in .NET are 16-bit (Unicode/UTF-16), not 8-bit like C++.

Is Xml Case-sensitive?

Yes, so <Student> and <student> are different elements.

What Debugging Tools Come With The .net Sdk?

CorDBG – command-line debugger, and DbgCLR – graphic debugger. Visual Studio .NET uses the DbgCLR. To use CorDbg, you must compile the original C# file using the /debug switch.

What Does The This Window Show In The Debugger?

It points to the object that’s pointed to by this reference. Object’s instance data is shown.

Subscribe to get more Posts :