1 2 3 > >>   Sort: Rank

What is the difference between System.String and System.StringBuilder classes
What is the difference between System.String and System.StringBuilder classes? System.String is immutable; System.StringBuilder can have mutable string where a variety of operations can be performed.
2007-10-23, 4582👍, 0💬

Can two catch blocks be executed
Can two catch blocks be executed? No, once the proper catch section is executed the control goes finally to block. So there will not be any scenarios in which multiple catch blocks will be executed.
2007-10-23, 6344👍, 0💬

Can we have static indexer in C#
Can we have static indexer in C# ? No.
2007-10-23, 6290👍, 0💬

What is Indexer
What is Indexer ? An indexer is a member that enables an object to be indexed in the same way as an array.
2007-10-23, 5126👍, 0💬

If we write a goto or a return statement in try and catch block will the finally block execute
If we write a goto or a return statement in try and catch block will the finally block execute ? The code in then finally always run even if there are statements like goto or a return statements.
2007-10-23, 5000👍, 0💬

Can we have different access modifiers on get/set methods of a property
Can we have different access modifiers on get/set methods of a property ? No we can not have different modifiers same property. The access modifier on a property applies to both its get and set accessors.
2007-10-23, 4887👍, 0💬

In what instances you will declare a constructor to be private
In what instances you will declare a constructor to be private? When we create a private constructor, we can not create object of the class directly from a client. So you will use private constructors when you do not want instances of the class to be created by any external client. Example UTILITY f...
2007-10-23, 4873👍, 0💬

How do I force the Dispose method to be called automatically , as clients can forget to call Dispose method
How do I force the Dispose method to be called automatically, as clients can forget to call Dispose method? Call the Dispose method in Finalize method and in Dispose method suppress the finalize method using GC.SuppressFinalize. Below is the sample code of the pattern. This is the best way we do cle...
2007-10-23, 7301👍, 0💬

What is the use of DISPOSE method
What is the use of DISPOSE method? Dispose method belongs to IDisposable interface. We had seen in the previous section how bad it can be to override the finalize method for writing the cleaning of unmanaged resources. So if any object wants to release its unmanaged code best is to implement IDispos...
2007-10-23, 4780👍, 0💬

How can we suppress a finalize method
How can we suppress a finalize method? GC.SuppressFinalize ()
2007-10-23, 5530👍, 0💬

Why is it preferred to not use finalize for clean up
Why is it preferred to not use finalize for clean up? Problem with finalize is that garbage collection has to make two rounds in order to remove objects which have finalize methods. Below figure will make things clear regarding the two rounds of garbage collection rounds performed for the objects ha...
2007-10-23, 6074👍, 0💬

What is the significance of Finalize method in .NET
What is the significance of Finalize method in .NET? .NET Garbage collector does almost all clean up activity for your objects. But unmanaged resources (ex: - Windows API created objects, File, Database connection objects, COM objects etc) is outside the scope of .NET framework we have to explicitly...
2007-10-23, 6437👍, 0💬

In below sample code if we create a object of class2 which constructor will fire first
In below sample code if we create a object of class2 which constructor will fire first? Public Class Class1 Sub New() End Sub End Class Public Class class2 Inherits Class1 Sub New() End Sub End Class
2007-10-23, 7553👍, 0💬

What is Operator Overloading in .NET
What is Operator Overloading in .NET? It provides a way to define and use operators such as +, -, and / for user-defined classes or structs. It allows us to define/redefine the way operators work with our classes and structs. This allows programmers to make their custom types look and feel like simp...
2007-10-23, 4658👍, 0💬

What is nested Classes
What is nested Classes ? Nested classes are classes within classes. In sample below “ClsNested” class has a “ChildNested” class nested inside it. Public Class ClsNested Public Class ChildNested Public Sub ShowMessage() MessageBox.Show(“Hi this is nested class”) End Sub End Class End Class This is ...
2007-10-23, 4504👍, 0💬

What is ENUM
What is ENUM ? It’s used to define constants.
2007-10-23, 4846👍, 0💬

What are queues and stacks
What are queues and stacks ? Queue is for first-in, first-out (FIFO) structures. Stack is for last-in, first-out (LIFO) structures.
2007-10-23, 4350👍, 0💬

What’s a HashTable
What’s difference between HashTable and ArrayList ? 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.
2007-10-23, 5922👍, 0💬

What is ArrayList
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.
2007-10-23, 4610👍, 0💬

Where are all .NET Collection classes located
Where are all .NET Collection classes located ? System.Collection namespace has all the collection classes available in .NET.
2007-10-23, 6405👍, 0💬

What is the use of “OverRides” and “Overridable” keywords
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
2007-10-23, 5419👍, 0💬

What is Dispose method in .NET
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.
2007-10-23, 4384👍, 0💬

What are shared (VB.NET)/Static(C#) variables
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 ...
2007-10-23, 6141👍, 0💬

What does virtual keyword mean
What does virtual keyword mean ? They signify that method and property can be overridden.
2007-10-23, 4831👍, 0💬

1 2 3 > >>   Sort: Rank