Beruflich Dokumente
Kultur Dokumente
com
http://net-informations.com/faq/default.htm
Which class is super class of all classes in .NET Classes?
You need an entry point into your program. A static method can be
called without instantiating an object. Therefore main() needs to be
static in order to allow it to be the entry to your program.
What is Upcasting ?
What is Downcasting?
No. You can't override a static method. A static method can't be virtual,
since it's not related to an instance of the class.
Yes. You have to create an instance of that class within the static
method and then call it, but you ensure there is only one instance.
Namespaces are containers for the classes. Namespaces are using for
grouping the related classes in C#.
3 % 2 == 1
The array which has elements of type array is called jagged array. The
elements can be of different dimensions and sizes.
We can also call jagged array as Array of arrays.
Prefix: increments the current value and then passes it to the function.
i = 10;
Console.WriteLine(++i);
Above code return 11 because the value of i is incremented, and the
value of the expression is the new value of i.
More Questions and Answers: http://net-informations.com/faq/default.htm
Postfix: passes the current value of i to the function and then increments
it.
i = 20;
Console.WriteLine(i++);
Above code return 20 because the value of i is incremented, but the
value of the expression is the original value of i
C# destructors are special methods that contains clean up code for the
object. You can not call them explicitly in your code as they are called
implicitly by GC.
In C# they have same name as the class name preceded by the ~ sign.
More Questions and Answers: http://net-informations.com/faq/default.htm
What is a structure in C#?
In C#, a structure is a value type data type. It helps you to make a single
variable hold related data of various data types. The struct keyword is
used for creating a structure.'
What's the difference between the Debug class and Trace class?
The Debug and Trace classes have very similar methods. The primary
difference is that calls to the Debug class are typically only included in
Debug build and Trace are included in all builds (Debug and Release).
Yes, you can. There is no requirement that abstract classes must have
abstract methods. An Abstract class means the definition of the class is
not complete and hence cannot be instantiated.
No. Because this points to an instance of the class, in the static method
you don't have an instance.
Yes..you can
Object pool is used to track the objects which are being used in the
code. So object pool reduces the object creation overhead.
this represents the current class instance while base the parent.
The reason for the "using" statement is to ensure that the object is
disposed as soon as it goes out of scope, and it doesn't require explicit
code to ensure that this happens. Using calls Dispose() after the using-
block is left, even if the code throws an exception.
What is a collection?
A collection works as a container for instances of other classes. All
classes implement ICollection interface.
Yes, it is possible to have try block without catch block by using finally
block. The "using" statement is equivalent try-finally.
What is Reflection?