Saturday, January 31, 2015

Cracking C# Interview Questions Part One

Most asked questions:

 Explain the difference between abstract class and interface.


Constructors:

What is Static Constructor?
Static constructor is used to initialize static data members as soon as the class is referenced for first time. Static constructor does not take access modifiers and or have any parameter and cannot access any non-static data member of class.

Whereas the instance constructor is used to initialize instance member of object of class. It is called whenever a new object is created ( either explicitly or implicitly).


Inheritance:

Are private data members inherited?
Yes, but they cannot be accessed by child class methods.

What are Delegates?
A delegate in C# allows us to pass a method of a class to object of another class that can call these methods. It is alias of function pointer in C++.

No comments:

Post a Comment

Cybersecurity Essential: OpenSSL

In today’s digital landscape, securing data is paramount. Whether you’re building web applications, managing servers, or developing software...