what is difference between const, static and readonly?
Answers were Sorted based on User's Feedback
Answer / magesh
const variable : const can never be modified and
must be initialized to a compile time constant.
Static variable : you received last updated value, when u
getting value for static variable.
Readonly variable : The readonly variable can be changed
inside the constructor.
Is This Answer Correct ? | 7 Yes | 0 No |
Answer / amit manekar
The difference is that static read-only 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 read-only 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).
Is This Answer Correct ? | 2 Yes | 1 No |
Can we make a class with class with same;suppose public class abc { public class abc { } }
What is Auto-event wireup? what is the default value for this? when u change the value what will happen?
What is the difference between pathparam and queryparam?
What is a postback ispostback and autopostback in asp net?
How we can bind textbox,listbox and datagrid to sql server database in asp.net using visualstudio.net language (vb.net)?
Name some asp objects?
how can u create the blog in asp.net with C#?what is the data type u will use to store in sql server?
About DataAdapters ?
What are the event handlers that can be included in the Global.asax file?
i have 3+ exp in .net? i am going interview now but they asked me do you know any TOOL? which tool will i study please refer me?
What type of code (server or client) is found in a Code- Behind class?
how we deploy the asp.net 2.0 application