-----------------------------------------------------------

New Message on BDOTNET

-----------------------------------------------------------
From: Mrinal
Message 11 in Discussion

Hi Darshan ,   I think there's some mistake with your concept , try this :   
Declare int variable at class level and try printing it in any method ( Console 
/ Winform ) application , it will surely print without any error for e.g :   
class test Project  {           int y ;   private void SomeMethod() { 
Console.WriteLine(y.ToString()) ; } }   However error that you mentioned will 
be there if you declare variable as local variable to the method , which is 
logical enough : In the above mentioned case integer being a primitive and 
class level variable is assigned the relevant value by the compiler itself 
while compiling  . However in case of local variable to a method , in IL  , we 
just have reference to the method , so that it can be jitted at runtime for 
execution , but before that compiler checks and is able to understand that 
there's a variable that is not initialized by either user or the compiler 
itself and it doesn't let the whole thing cross compilation stage . 
However even if we declare class variable , it will be a warning , depending on 
the warning level chosen .   Hope it helps ,   thanks ,   Mrinal .

-----------------------------------------------------------

To stop getting this e-mail, or change how often it arrives, go to your E-mail 
Settings.
http://groups.msn.com/bdotnet/_emailsettings.msnw

Need help? If you've forgotten your password, please go to Passport Member 
Services.
http://groups.msn.com/_passportredir.msnw?ppmprop=help

For other questions or feedback, go to our Contact Us page.
http://groups.msn.com/contact

If you do not want to receive future e-mail from this MSN group, or if you 
received this message by mistake, please click the "Remove" link below. On the 
pre-addressed e-mail message that opens, simply click "Send". Your e-mail 
address will be deleted from this group's mailing list.
mailto:[EMAIL PROTECTED]

Reply via email to