C# Algorithm Interview Questions and Answers - 2

Question: 6

What is a delegate?

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

Question: 7

Differentiate between Friend and Protected Friend?

Entities declared with the Friend modifier have Friend access.

An entity with Friend access is accessible only within the program that contains the entity declaration.

Entities declared with the Protected Friend modifiers have the union of Protected and Friend access.

Question: 8

What is the difference between Array and Array list?

As elements are added to an array list, the capacity is automatically increased as required through reallocation.

The capacity can be decreased by calling TrimToSize or by setting the Capacity property explicitly.

Question: 9

What’ the difference between // comments, /**/ comments and /// comments?

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

Question: 10

How do you generate documentation from the C# file commented properly with a command-line compiler?

Compile it with the /doc switch.

Related Questions