-
'this' in C#
Explain about 'this' and where and when it should be used?
-
Shallow and Deep Copy
What is shallow and deep copy in C#? How to perform the same in C#?
-
Garbage Collector Generations Algorithm
Explain the Generations Algorithm used in the context of Garbage Collector
-
Design Patterns
What kind of design patterns can be used for C# development projects?
-
Classes Interface
Explain how many classes can an interface inherit?
-
C# pointers
Can we use pointer in c# ?if we can then how it can implement ?and if no then why we can not use pointer in c#?
-
-
ByteArray Class
Write a class called ByteArray that implement allocating, reading and writing to an array of bytes. The runtime environment has a limitation. The maximum continuous memory size that it can allocated is 64k bytes. It can allocate many 64K ( or less) chunks. The ByteArray class should hide this limitation and support allocating arrays larger than 64K as in the following example :ByteArray ba = new ByteArray...
-
Debug C# Web Application
How to debug C# Web Application?
-
Operator Overloading
Why should we have to overload ==(equals) and !=(not equals) operators in same program? If any one is not overloaded it gives error. Same with =?
-
Define reflection
What is reflection and assembly?
-
Reference variable of Interface
It is possible to create the reference variable of an Interface which is 100% abstract in nature.Then why it is not possible to create a reference of an Abstract class?
-
How do I make a DLL in C#?
You need to use the /target:library compiler option.
-
Does C# support templates?
No. However, there are plans for C# to support a type of template known as a generic. These generic types have similar syntax but are instantiated at run time as opposed to compile time. You can read more about them here.
-
How do you implement thread synchronization (Object.Wait, Notify,and CriticalSection) in C#?
You want the lock statement, which is the same as Monitor Enter/Exit: lock(obj) {// code}translates to: try {CriticalSection.Enter(obj);// code} finally {CriticalSection.Exit(obj);}
-
How do I create a multilanguage, single-file assembly?
This is currently not supported by Visual Studio .NET.
-
How do I convert a string to an int in C#?
Here's an example: using System;class StringToInt{public static void Main(){String s = "105";int x = Convert.ToInt32(s);Console.WriteLine(x);}}
-
How does one compare strings in C#?
In the past, you had to call .ToString() on the strings when using the == or != operators to compare the strings' values. That will still work, but the C# compiler now automatically compares the values instead of the references when the == or != operators are used on string types. If you actually do want to compare references, it can be done as follows: if ((object) str1 == (object) str2) { ... }Here's...
-
What is the difference between a struct and a class in C#?
From language spec:The list of similarities between classes and structs is as follows. Longstructs can implement interfaces and can have the same kinds of members as classes. Structs differ from classes in several important ways; however, structs are value types rather than reference types, and inheritance is not supported for structs. Struct values are stored on the stack or in-line. Careful programmers...
-
How is method overriding different from overloading?
When overriding, you change the method behavior for a derived class. Overloading simply involves having a method with the same name within the class.
C# Interview Questions
Ans