<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ru">
		<id>http://nfex.ru/index.php?action=history&amp;feed=atom&amp;title=Csharp%2FC_Sharp%2FLanguage_Basics%2FVariable_Scope</id>
		<title>Csharp/C Sharp/Language Basics/Variable Scope - История изменений</title>
		<link rel="self" type="application/atom+xml" href="http://nfex.ru/index.php?action=history&amp;feed=atom&amp;title=Csharp%2FC_Sharp%2FLanguage_Basics%2FVariable_Scope"/>
		<link rel="alternate" type="text/html" href="http://nfex.ru/index.php?title=Csharp/C_Sharp/Language_Basics/Variable_Scope&amp;action=history"/>
		<updated>2026-04-29T23:47:31Z</updated>
		<subtitle>История изменений этой страницы в вики</subtitle>
		<generator>MediaWiki 1.30.0</generator>

	<entry>
		<id>http://nfex.ru/index.php?title=Csharp/C_Sharp/Language_Basics/Variable_Scope&amp;diff=728&amp;oldid=prev</id>
		<title> в 15:31, 26 мая 2010</title>
		<link rel="alternate" type="text/html" href="http://nfex.ru/index.php?title=Csharp/C_Sharp/Language_Basics/Variable_Scope&amp;diff=728&amp;oldid=prev"/>
				<updated>2010-05-26T15:31:18Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr style=&quot;vertical-align: top;&quot; lang=&quot;ru&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Предыдущая&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Версия 15:31, 26 мая 2010&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; style=&quot;text-align: center;&quot; lang=&quot;ru&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(нет различий)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
			</entry>

	<entry>
		<id>http://nfex.ru/index.php?title=Csharp/C_Sharp/Language_Basics/Variable_Scope&amp;diff=729&amp;oldid=prev</id>
		<title>Admin: 1 версия</title>
		<link rel="alternate" type="text/html" href="http://nfex.ru/index.php?title=Csharp/C_Sharp/Language_Basics/Variable_Scope&amp;diff=729&amp;oldid=prev"/>
				<updated>2010-05-26T11:39:40Z</updated>
		
		<summary type="html">&lt;p&gt;1 версия&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Новая страница&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==Class level Variable scope==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;&lt;br /&gt;
/*&lt;br /&gt;
C# Programming Tips &amp;amp; Techniques&lt;br /&gt;
by Charles Wright, Kris Jamsa&lt;br /&gt;
Publisher: Osborne/McGraw-Hill (December 28, 2001)&lt;br /&gt;
ISBN: 0072193794&lt;br /&gt;
*/&lt;br /&gt;
namespace nsScope&lt;br /&gt;
{&lt;br /&gt;
    using System;&lt;br /&gt;
    public class Scope&lt;br /&gt;
    {&lt;br /&gt;
        int Var = 42;&lt;br /&gt;
        static public void Main ()&lt;br /&gt;
        {&lt;br /&gt;
            Scope cls = new Scope();&lt;br /&gt;
            int Var = 23;&lt;br /&gt;
            Console.WriteLine (&amp;quot;Class variable = &amp;quot; + cls.Var);&lt;br /&gt;
            Console.WriteLine (&amp;quot;Function variable = &amp;quot; + Var);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
           &lt;br /&gt;
       &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==method scope variable==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt; &lt;br /&gt;
using System;&lt;br /&gt;
class IncDecApp&lt;br /&gt;
{&lt;br /&gt;
    public static void Foo(int j)&lt;br /&gt;
    {&lt;br /&gt;
        Console.WriteLine(&amp;quot;IncDecApp.Foo j = {0}&amp;quot;, j);&lt;br /&gt;
    }&lt;br /&gt;
   &lt;br /&gt;
    static void Main(string[] args)&lt;br /&gt;
    {&lt;br /&gt;
        int i = 1;&lt;br /&gt;
   &lt;br /&gt;
        Console.WriteLine(&amp;quot;Before Foo(i++) = {0}&amp;quot;, i);&lt;br /&gt;
        Foo(i++);&lt;br /&gt;
        Console.WriteLine(&amp;quot;After Foo(i++) = {0}&amp;quot;, i);&lt;br /&gt;
   &lt;br /&gt;
        Console.WriteLine();&lt;br /&gt;
   &lt;br /&gt;
        Console.WriteLine(&amp;quot;Before Foo(++i) = {0}&amp;quot;, i);&lt;br /&gt;
        Foo(++i);&lt;br /&gt;
        Console.WriteLine(&amp;quot;After Foo(++i) = {0}&amp;quot;, i);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
 &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Scope class demonstrates instance and local variable scopes.==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
using System;&lt;br /&gt;
public class Scope&lt;br /&gt;
{&lt;br /&gt;
   private int x = 1;&lt;br /&gt;
   public void Begin()&lt;br /&gt;
   {&lt;br /&gt;
      int x = 5; &lt;br /&gt;
      Console.WriteLine(x );&lt;br /&gt;
      UseLocalVariable();&lt;br /&gt;
      UseInstanceVariable();&lt;br /&gt;
      UseLocalVariable();&lt;br /&gt;
      UseInstanceVariable();&lt;br /&gt;
      Console.WriteLine(x );&lt;br /&gt;
   } &lt;br /&gt;
   public void UseLocalVariable()&lt;br /&gt;
   {&lt;br /&gt;
      int x = 25; &lt;br /&gt;
      Console.WriteLine(&amp;quot;UseLocalVariable is {0}&amp;quot;, x );&lt;br /&gt;
      x++;  &lt;br /&gt;
      Console.WriteLine(&amp;quot;before exiting UseLocalVariable is {0}&amp;quot;, x );&lt;br /&gt;
   } &lt;br /&gt;
   public void UseInstanceVariable()&lt;br /&gt;
   {&lt;br /&gt;
      Console.WriteLine( &amp;quot;instance variable x on entering {0} is {1}&amp;quot;,&amp;quot;method UseInstanceVariable&amp;quot;, x );&lt;br /&gt;
      x *= 10;  &lt;br /&gt;
      Console.WriteLine( &amp;quot;instance variable x before exiting {0} is {1}&amp;quot;,&amp;quot;method UseInstanceVariable&amp;quot;, x );&lt;br /&gt;
   } &lt;br /&gt;
} &lt;br /&gt;
public class ScopeTest&lt;br /&gt;
{&lt;br /&gt;
   public static void Main( string[] args )&lt;br /&gt;
   {&lt;br /&gt;
      Scope testScope = new Scope();&lt;br /&gt;
      testScope.Begin();&lt;br /&gt;
   }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
       &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Scoping in C#.==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt; &lt;br /&gt;
&lt;br /&gt;
using System;&lt;br /&gt;
class MainClass {&lt;br /&gt;
    // Class level x variable&lt;br /&gt;
    static int x = 10;&lt;br /&gt;
    public static void Main() {&lt;br /&gt;
        // Locally defined copy of x&lt;br /&gt;
        int x = 5;&lt;br /&gt;
        int y = x;&lt;br /&gt;
        double z = y + 10.25;&lt;br /&gt;
        int a = (int)z;&lt;br /&gt;
        Console.WriteLine(&amp;quot;X = {0} Y = {1} Z = {2}&amp;quot;, x, y, z);&lt;br /&gt;
        Console.WriteLine(&amp;quot;A = {0}&amp;quot;, a);&lt;br /&gt;
        Console.WriteLine(&amp;quot;Class Level X = {0}&amp;quot;, MainClass.x);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
 &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==System maximums and minimums.==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt; &lt;br /&gt;
&lt;br /&gt;
using System;&lt;br /&gt;
class MainClass {&lt;br /&gt;
    public static void Main() {&lt;br /&gt;
        // First, print out the minimum values&lt;br /&gt;
        Console.WriteLine(&amp;quot;System Minimums\n&amp;quot;);&lt;br /&gt;
        Console.WriteLine(&amp;quot;MinSByte {0}&amp;quot;, System.SByte.MinValue);&lt;br /&gt;
        Console.WriteLine(&amp;quot;MinByte {0}&amp;quot;, System.Byte.MinValue);&lt;br /&gt;
        Console.WriteLine(&amp;quot;MinInt16 {0}&amp;quot;, System.Int16.MinValue);&lt;br /&gt;
        Console.WriteLine(&amp;quot;MinUInt16 {0}&amp;quot;, System.UInt16.MinValue);&lt;br /&gt;
        Console.WriteLine(&amp;quot;MinInt32 {0}&amp;quot;, System.Int32.MinValue);&lt;br /&gt;
        Console.WriteLine(&amp;quot;MinUInt32 {0}&amp;quot;, System.UInt32.MinValue);&lt;br /&gt;
        Console.WriteLine(&amp;quot;MinInt64 {0}&amp;quot;, System.Int64.MinValue);&lt;br /&gt;
        Console.WriteLine(&amp;quot;MinUInt64 {0}&amp;quot;, System.UInt64.MinValue);&lt;br /&gt;
        Console.WriteLine(&amp;quot;MinChar {0}&amp;quot;, System.Char.MinValue);&lt;br /&gt;
        Console.WriteLine(&amp;quot;MinSingle {0}&amp;quot;, System.Single.MinValue);&lt;br /&gt;
        Console.WriteLine(&amp;quot;MinDouble {0}&amp;quot;, System.Double.MinValue);&lt;br /&gt;
        // Console.WriteLine( &amp;quot;MinBoolean {0}&amp;quot;, System.Boolean.MinValue);&lt;br /&gt;
        Console.WriteLine(&amp;quot;MinDecimal {0}&amp;quot;, System.Decimal.MinValue);&lt;br /&gt;
        Console.WriteLine(&amp;quot;\nSystem Maximums\n&amp;quot;);&lt;br /&gt;
        Console.WriteLine(&amp;quot;MaxSByte {0}&amp;quot;, System.SByte.MaxValue);&lt;br /&gt;
        Console.WriteLine(&amp;quot;MaxByte {0}&amp;quot;, System.Byte.MaxValue);&lt;br /&gt;
        Console.WriteLine(&amp;quot;MaxInt16 {0}&amp;quot;, System.Int16.MaxValue);&lt;br /&gt;
        Console.WriteLine(&amp;quot;MaxUInt16 {0}&amp;quot;, System.UInt16.MaxValue);&lt;br /&gt;
        Console.WriteLine(&amp;quot;MaxInt32 {0}&amp;quot;, System.Int32.MaxValue);&lt;br /&gt;
        Console.WriteLine(&amp;quot;MaxUInt32 {0}&amp;quot;, System.UInt32.MaxValue);&lt;br /&gt;
        Console.WriteLine(&amp;quot;MaxInt64 {0}&amp;quot;, System.Int64.MaxValue);&lt;br /&gt;
        Console.WriteLine(&amp;quot;MaxUInt64 {0}&amp;quot;, System.UInt64.MaxValue);&lt;br /&gt;
        Console.WriteLine(&amp;quot;MaxChar {0}&amp;quot;, System.Char.MaxValue);&lt;br /&gt;
        Console.WriteLine(&amp;quot;MaxSingle {0}&amp;quot;, System.Single.MaxValue);&lt;br /&gt;
        Console.WriteLine(&amp;quot;MaxDouble {0}&amp;quot;, System.Double.MaxValue);&lt;br /&gt;
        Console.WriteLine(&amp;quot;MaxDecimal {0}&amp;quot;, System.Decimal.MaxValue);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
 &amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	</feed>