Beispiel #1
0
        static void Main(string[] args)
        {
            /*
            Method Parametre Tipleri
            1. Deger Tipli Parametre
            2. Referans tipli parametre
            3. Çıktı tipli parametre
            4. Params parametreleri
            */

            int deger = 0;
            Degistir1(deger);
            //Console.WriteLine("Degistir1 " + deger.ToString());
            Console.WriteLine("Degistir1 - Deger 1 Tipli : {0}", deger);

            deger = 0;
            Degistir2(deger);
            Console.WriteLine("Degistir2 - Deger 2 tipli {0}", deger);

            MyInt myIntDegeri = new MyInt();
            myIntDegeri.deger = 0;
            Degistir3(myIntDegeri);
            Console.WriteLine("Degistir3 - Referans 1 tipli {0}", myIntDegeri.deger);

            deger = 0;
            Degistir4(ref deger);
            Console.WriteLine("Degistir4 - Referans 2 tipli {0}", deger);

            deger = 0;
            Degistir5(out deger);
            Console.WriteLine("Degistir5 - Çıktı tipli {0}", deger);

            Console.ReadKey();
        }
Beispiel #2
0
 // Referans 2 tipli parametre
 private static void Degistir3(MyInt myIntDegeri)
 {
     myIntDegeri.deger = 3;
 }