-
'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?
-
Why does DllImport not work for me?
All methods marked with the DllImport attribute must be marked as public static extern.
-
Is there a way to force garbage collection?
Yes. Set all references to null and then call System.GC.Collect().If you need to have some objects destructed, and System.GC.Collect() doesn't seem to be doing it for you, you can force finalizers to be run by setting all the references to the object to null and then calling System.GC.RunFinalizers().
-
I was trying to use an "out int" parameter in one of my functions. How should I declare the variable that I am passing to it?
You should declare the variable as an int, but when you pass it in you must specify it as 'out', like the following: int i;foo(out i);where foo is declared as follows: [return-type] foo(out int o) { }
-
Does C# support properties of array types?
Yes. Here's a simple example: using System;class Class1 {private string[] MyField;public string[] MyProperty {get { return MyField; }set { MyField = value; }}}class MainClass{public static int Main(string[] args) {Class1 c = new Class1();string[] arr = new string[] {"apple", "banana;c.MyProperty = arr;Console.WriteLine(c.MyProperty[0]); // "apple"return 0;}}
-
Can you allow class to be inherited, but prevent the method from being over-ridden?
Yes, just leave the class public and make the method sealed.
-
What is a delegate?
A delegate object encapsulates a reference to a method. In C++ they were referred to as function pointers.
-
What is CLS?
Skill/Topic: BeginnerA) Common Language SpecificationB) Common Library SystemC) Csharp Language SpecificationD) Code Location Specification
-
What is CLR?
Skill/Topic: BeginnerA) Common Library ReorganizationB) Csharp Language RespecificationC) Csharp Library RosterD) Common Language Runtime
C# Interview Questions
Ans