C# Exclusive Interview Questions and Answers (453) - Page 2

  • A joint initiative from DotNetFunda.Com and Questpond.
  • A one stop place on the internet to get trusted and proven Interview Questions (based on more than a decade of experience in this field) to ensure the success of the candidates.
  • You will find almost all Interview questions from Questpond here and this list is growing day by day with all latest and updated interview questions.

453 records found.

Get 650+ Questpond's Interview videos on discount

What are access modifiers used for encapsulation?

The access modifiers in .NET are

1. public

2. private

3. protected

4. internal

5. protected internal


Which Exception will be thrown If TryParse fails?

It will throws FormatException if it fails.
Can we change the Size of Array at runtime?

Yes,using Redim we can dynamically change the size of array.
What is Redim in VB.NET?

In VB.NET we use Redim and erase to manipulate Array. Once we declare an array the size set to any its makes limited to that range but with the help of redim we used to change the any size.
How can we use Keywords as Identifiers?

If Keywords have to be used as Identifiers enclose them in [ ]. ex:Function [sub](a as Integer, b as Integer) as Integer return a-b End Function
Can a method be overloaded based on return type?

Having two or more methods with same name and different parameters. parameters must be different either in their datatypes or in their count.
What is the difference between String And StringBuilder ?

For every modification we perform on the string, a new string will be created whereas StringBuilder does not create new object it modifies the existing one. Hence, if there is a need to perform multiple operation on string better choice is StringBuilder.
Why Arrays are called Dynamic ?

Because we can set ( not change) the size of an Array dynamically
What is the use of Step keyword in a For Loop?

To increment or decrement the For loop
Can we overload contructors

Yes, We can have Default Constructor, Parameterised and Copy Contructor in every class.
What is the advantage of Copy constructor

Copy Constructor is used to create a new object by duplicating the state of an existing object and this is done by copying the value of data members of existing object in new object data members.
Define the use of Caspol.exe.

It is DOS command to view and alter code access security policy.
Can a desctructor be declared as public

No, destructor should not have any access specifier.
Instance member of a class cannot access static members of the class: Yes / No ? If No Justify

No. Instance methods can access static members but static members cannot access instance members.
Does Garbage Collection disposes a object even if you abort the application in the middle? How to check this?

Garbage Collector runs as a seperate thread in the .NET runtime and not in the application we create. Even if the application crashes GC will collect all the memory occupied by our program as there is no reference to those objects. To check if it is collected or not we can try some CLR monitoring tools like CLR Profiler
Define protected class-level variable in C#.NET.

It can be inherited by the classes in the same namespace.
Define encapsulation.

Binding of data & behavior that means functionality of an object within a controlled & secured environment is encapsulation.
What is the use of destructor in .net?

Destructor of a class is used to destroy COM objects which are created by it in unmanaged heap.

More C# Interview Questions & Answers here

Found this useful, bookmark this page to the blog or social networking websites. Page copy protected against web site content infringement by Copyscape

 Exclusive Interview Questions and Answers Categories