Exemple #1
0
    static void Main()
    {
        string s1 = "bilgisayar";
        int i1 = 71;
        double d1 = 49.94;

        Console.WriteLine("1. ASAMA:");
        Console.WriteLine("[s1] --> tip : {0}, deger : {1}", typeof(string), s1);
        Console.WriteLine("[i1] --> tip : {0}, deger : {1}", typeof(int), i1);
        Console.WriteLine("[d1] --> tip : {0}, deger : {1}", typeof(double), d1);

        string s1_str = "[str]" + s1;
        string i1_str = "[int]" + i1.ToString();
        string d1_str = "[dbl]" + d1.ToString();

        Console.WriteLine("\n2. ASAMA:");
        Console.WriteLine("[s1_str] --> tip : {0}, deger : {1}", typeof(string), s1_str);
        Console.WriteLine("[i1_str] --> tip : {0}, deger : {1}", typeof(string), i1_str);
        Console.WriteLine("[d1_str] --> tip : {0}, deger : {1}", typeof(string), d1_str);

        object s1_obj = (object)s1_str;
        object i1_obj = (object)i1_str;
        object d1_obj = (object)d1_str;

        Console.WriteLine("\n3. ASAMA:");
        Console.WriteLine("[s1_obj] --> tip : {0}, deger : {1}", typeof(object), s1_obj);
        Console.WriteLine("[i1_obj] --> tip : {0}, deger : {1}", typeof(object), i1_obj);
        Console.WriteLine("[d1_obj] --> tip : {0}, deger : {1}", typeof(object), d1_obj);

        Console.WriteLine("\n4. ASAMA:");

        Sinif1 s1_Sinif1 = new Sinif1(s1_obj);
        Sinif1 i1_Sinif1 = new Sinif1(i1_obj);
        Sinif1 d1_Sinif1 = new Sinif1(d1_obj);

        s1_Sinif1.Yaz();
        i1_Sinif1.Yaz();
        d1_Sinif1.Yaz();

        Console.ReadLine();
    }
        private void Form1_Load(object sender, EventArgs e)
        {
            Sinif1 s1 = new Sinif1();

            digersiniflar.Sinif2 s2 = new digersiniflar.Sinif2();
        }
Exemple #3
0
    static void Main()
    {
        Sinif1 nesne1 = new Sinif1();

        // Acik donusum: int --> Ses
        nesne1.KullanicidanSabitListesiAl();

        // Ses listesinde ada gore gez
        nesne1.ListeUyeleriniAdaGoreSirala();

        // Ses listesinde degere gore gez
        nesne1.ListeUyeleriniDegereGoreSirala();

        Console.ReadLine();
    }