C#.NET INTERVIEW QUESTION & ANSWERS
DOT Net
TAGS
6. | What is the difference between const and static readonly? |
---|---|
The difference is that static readonly can be modified by the containing class, but const can never be modified and must be initialized to a compile time constant. To expand on the static readonly case a bit, the containing class
can only modify it: - in the variable declaration (through a variable initializer) - in the static constructor (instance constructors if it's not static). |
7. | What is an Indexer? |
---|---|
An indexer is a member that enables an object to be indexed in the same way as an array. |
8. | What is difference between constants, readonly and, static ? |
---|---|
|
9. | What is a static constructor? |
---|---|
A constructor for a class, rather than instances of a class. The static constructor is called when the class is loaded. |
Posted by Surender. (Nov 14, 2013) | |
Static constructor does not contain parameters. class contain only one static constructors. |
|
Posted by Aditya. (May 01, 2013) | |
Constructor has same name of class. if class name is ‘a’ than it should necessary the constructor name is also ‘a’'. |
10. | What is a Class? |
---|---|
A class describes all the attributes of objects as well as the methods that implements the behavior of member objects. |
Posted by Arun. (Jun 27, 2014) | |
Class is a collection of object and methods.A new keyword is used to create an object. |
|
Posted by Rukasana H Dange. (Jan 23, 2014) | |
Class is collection of an object. It is a blueprint that describes the details(characteristics and behaviour) of an object for e.g |
|
Posted by Chandan. (May 22, 2013) | |
Class is a collection object. Class is a collection of data member & member function. Class has no existance. |