Advertisement
fcamuso

Scoping Rules - terza (e ultima) parte

Jan 11th, 2021
380
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.90 KB | None | 0 0
  1. using System;
  2. using A.A1.A11;
  3. using Progetto2;
  4.  
  5. namespace A
  6. {
  7.   interface ISwappable { }
  8.  
  9.   namespace A1
  10.   {
  11.     namespace A11
  12.     {
  13.       class Vector
  14.       {
  15.         readonly double x = 0;
  16.         public int A { get; set; }
  17.  
  18.         public Vector() { }
  19.         public void F()
  20.         {        
  21.          
  22.           void G()
  23.           {
  24.             //I();
  25.             void H()
  26.             {
  27.  
  28.                void I() { }
  29.             }
  30.          
  31.           }
  32.  
  33.  
  34.         }
  35.       }
  36.     }
  37.   }
  38. }
  39.  
  40. namespace ScopingRules
  41. {
  42.   interface ISwappable { }
  43.  
  44.   class ListaLinkata
  45.   {
  46.     Vector y = new Vector();
  47.     sorgente2 s2 = new sorgente2();
  48.  
  49.     Classe cl = new Classe();
  50.  
  51.     Nodo head = null;
  52.     double x = 3.8;
  53.     static string desc = "V 1.1";
  54.    
  55.  
  56.     public void AggiungiInTesta(Nodo nuovo) { }
  57.     public void AggiungiInCoda(Nodo nuovo) { }
  58.     public Nodo EstraiTesta() { return null; }
  59.  
  60.     public void F(Nodo n) { }
  61.    
  62.     public class Nodo
  63.     {
  64.       internal object data = null;
  65.       internal Nodo next = null;
  66.  
  67.       public Nodo() { }
  68.  
  69.       public void F(ListaLinkata ll)
  70.       {
  71.         string s = "ciao";
  72.  
  73.         //static
  74.         void MetodoLocale()
  75.         {
  76.           int n = 0;
  77.           {
  78.             while (true)
  79.             {
  80.               string ss = s;
  81.             }
  82.  
  83.           }
  84.           Console.WriteLine(s);
  85.           Console.WriteLine(data.ToString());
  86.         }
  87.  
  88.         int n = 0;
  89.  
  90.         void MetodoLocale2()
  91.         {
  92.           int n = 0;
  93.  
  94.           Console.WriteLine(s);
  95.         }
  96.  
  97.         Console.WriteLine(ListaLinkata.desc);
  98.         Console.WriteLine(ll.x);
  99.  
  100.        
  101.       }
  102.     }
  103.   }
  104.  
  105.  
  106.   class Program
  107.   {
  108.     static void Main(string[] args)
  109.     {
  110.       //ListaLinkata.Nodo n = new ListaLinkata.Nodo();
  111.  
  112.       //int z = 9;
  113.  
  114.       //{
  115.       //  int i = z;
  116.       //}
  117.  
  118.       //double x = 4.7;
  119.  
  120.  
  121.       //{
  122.       //  int i = 999;
  123.       //}
  124.  
  125.       //{
  126.       //  int j = 999;
  127.       //}
  128.  
  129.       ////int m = 20;
  130.  
  131.       //switch (z)
  132.       //{
  133.       //  case 1:
  134.       //    {
  135.       //      int m = 9;
  136.       //    }
  137.       //  break;
  138.  
  139.       //  case 2:
  140.       //    {
  141.       //      int m = 9;
  142.       //    }
  143.  
  144.       //    break;
  145.       //}
  146.  
  147.       //int n = 8;
  148.  
  149.       if (true)
  150.       {
  151.         int n = 100;
  152.  
  153.         if (true)
  154.         {
  155.           //int k;
  156.           //int z;
  157.           //int n = 0; //int i = 10; NO conflitto con la n esterna
  158.         }
  159.         {
  160.           //int z;
  161.           //z = 4000;
  162.         }
  163.  
  164.         int k;
  165.       }
  166.       else
  167.       {
  168.         //int n = 300;
  169.  
  170.         while (true)
  171.         {
  172.           //int n = 6;
  173.         }
  174.       }
  175.  
  176.       int z;
  177.  
  178.       while (true)
  179.       {
  180.        
  181.         int n = 0;
  182.         break;
  183.  
  184.       }
  185.  
  186.       for (int n = 0; n < 100; n++)
  187.       {
  188.        
  189.       }
  190.  
  191.       //double args = 0.0;
  192.  
  193.     }
  194.   }
  195. }
  196.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement