How do u declare static variable and how it is declared and what is its lifetime?

Showing Answers 1 - 4 of 4 Answers

Bhasker Das

  • Sep 20th, 2005
 

By using keyword static before the variable name. Static variable retains the same data throughout the execution of a program.

  Was this answer useful?  Yes

guest

  • Aug 6th, 2011
 

Yes it is possible to change the value of static variable. Here is the sample code how you can do that

Try this:

Code
  1. span style="color: #ff0000;">"static""non statick";

  2.             Console.WriteLine(  st);

  3.             Console.Read();

  4.         }

  5.     }

  6. }

  Was this answer useful?  Yes

rajiii

  • Aug 9th, 2011
 

by using static keyword we can declare static variable and its lifetime is the life of the program

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions