.Net Interview Questions and Answers – Part 7

61. What are the new thee features of COM+ services, which are not there in COM (MTS)?
Role based security.
Neutral apartment threading.
New environment called context which defines the execution environment

62. What are the differences between COM architecture and.NET architecture?
.Net architecture has superseded the old COM architecture providing a flexible rapid application development environment which can be used to create windows, web and console applications and web services. .NET provides a powerful development environment that can be used to create objects in any .NET compliant language.
.NET addresses the previous problems of dll hell with COM by providing strongly named assemblies and side-by-side execution where two assemblies with the same name can run on the same box.

63. Can we copy a COM dll to GAC folder?
No. It only stores .NET assemblies.

64. What is Shared and Repeatable Inheritance?
Shared Inheritance-: ITt is multiple times using same class. The mechanism of deriving a new class from an existing class is called inheritance. Shared inheritance introduces a new opportunity of ambiguity and additional implementation complexity. Assume D inherits from B and C, both of which inherits from A. Here A in shared. Single copy made from both derived classes is called shared inheritance.

65. Can you explain what inheritance is and an example of when you might use it?
Inheritance is a fundamental feature of any OO language. It allows us to inherit the members and attributes from a base class to a new derived class. This leads to increased code reusability and also makes applications easier to develop, maintain and extend as the new derived class can contain new features not available in the base class whilst at the same time preserving the attributes inherited from the base class.

66.  How can you write a class to restrict that only one object of this class can be created (Singleton class)?
Use the singleton design pattern.

public sealed class Singleton
static readonly Singleton Instance=new Singleton();
static Singleton()

public static Singleton Instance
return Instance;


67. What are virtual destructures?
A constructor can not be virtual but a destructor may. Use virtual destructors when you want to implement polymorphic tearing down of an object.

68. What is close method? How its different from Finalize and Dispose?
finalise is the process that allows the garbage collector to clean up any unmanaged resources before it is destroyed.
The finalise method can not be called directly; it is automatically called by the CLR. In order to allow more control over the release of unmanaged resources
the .NET framework provides a dispose method which unlike finalise can be called directly by code.
Close method is same as dispose. It was added as a convenience.

69.  What is Boxing and UnBoxing?
Boxing is the process of converting a value type to a reference type. More specifically it involves encapsulating a copy of the object and moving it from
stack to heap. Unboxing is the reverse process.

70.  What is check/uncheck?
checked: used to enable overflow checking for arithmetic and conversion functions.
unchecked: used to disable overflow checking for arithmetic and conversion functions

Leave a Reply

Your email address will not be published. Required fields are marked *

  • Get Alert

    Enter your email address:

  • Categories

  • Twitter

Subscribe Now!
Sign-up for our email newsletter and get free job alerts, current affairs and GK updates regularly.

Subscribe Here

Popup Dialog Box Powered By : XYZScripts.com
  • RSS
  • Facebook
  • Google+
  • Twitter