Blog Home  Home Feed your aggregator (RSS 2.0)  
Software Code Help - what is the variable scope in .net
Blog
 
# Wednesday, December 02, 2009

The scope of a variable is the region of code from which the variable can be accessed. In general, the scope is determined by the following rules:

  • A field (also known as a member variable) of a class is in scope for as long as its containing class is in scope (this is the same as for C++, Java, and VB).
  • local variable is in scope until a closing brace indicates the end of the block statement or method in which it was declared.
  • A local variable that is declared in a for, while, or similar statement is in scope in the body of that loop.

Wednesday, December 02, 2009 9:07:39 AM (GMT Standard Time, UTC+00:00)  #    Comments [0]   Interview Question .Net  | 
Copyright © 2010 SoftwareCodeHelp. All rights reserved.
DasBlog 'Portal' theme by Johnny Hughes.
Pick a theme: