|
|
| Do interface have accessibility modifier? |
All elements in Interface should be public. So by default all interface elements are public by default.
|
| What are similarities between Class and structure? |
|
|
Following are the similarities between classes and structures :-
Both can have constructors, methods, properties, fields, constants, enumerations, events, and event handlers.
Structures and classes can implement interface.
Both of them can have constructors with and without parameter.
Both can have delegates and events.
|
|
| What is the difference between Class and structures? |
Following are the key differences between them :
Structure are value types and classes are reference types. So structures use stack and classes use heap.
structures members can not be declared as protected, but class members can be. You can not do inheritance in structures.
Structures do not require constructors while classes require.
Objects created from classes are terminated using Garbage collector. Structures are not destroyed using GC.
|
| What does virtual keyword mean? |
They signify that method and property can be overridden.
|
| What are shared (VB.NET)/Static(C#) variables? |
|
Static/Shared classes are used when a class provides functionality which is not specific to any instance.
In short if you want an object to be shared between multiple instances you will use a static/ Shared class.
Following are features of Static/Shared classes :
They cannot be instantiated. By default a object is created on the first method call to that object.
Static/Shared classes cannot be inherited.
Static/Shared classes can have only static members.
Static/Shared classes can have only static constructor.
|
|
|
| What is Dispose method in .NET? |
.NET provides "Finalize" method in which we can clean up our resources. But relying on this is not always good so the best is to implement "Idisposable" interface and implement the "Dispose" method where you can put your clean up routines.
|
| What is the use of "OverRides" and "Overridable" keywords? |
Overridable is used in parent class to indicate that a method can be overridden. Overrides is used in the child class to indicate that you are overriding a method.
|
| Where are all .NET Collection classes located? |
System.Collection namespace has all the collection classes available in .NET.
|
| What is ArrayList? |
Array is whose size can increase and decrease dynamically. Array list can hold item of different types. As Array List can increase and decrease size dynamically you do not have to use the REDIM keyword. You can access any item in array using the INDEX value of the array position.
|
| What is a Hash Table? |
You can access array using INDEX value of array, but how many times you know the real value of index. Hashtable provides way of accessing the index using a user identified KEY value, thus removing the INDEX problem.
|
|
|
|
|