Example #1
0
 private void button5_Click(object sender, EventArgs e)
 {
     List <object>        list;
     GenericAccount <int> account1 = new GenericAccount <int> {
         Id = 3, Sum = 5000
     };
 }
Example #2
0
        private void button4_Click(object sender, EventArgs e)
        {
            GenericAccount <int> account1 = new GenericAccount <int> {
                Sum = 5000
            };
            GenericAccount <string> account2 = new GenericAccount <string> {
                Sum = 4000
            };

            account1.Id = 2;          // упаковка не нужна
            account2.Id = "4356";
            int    id1 = account1.Id; // распаковка не нужна
            string id2 = account2.Id;

            makeOutput(id1);
            makeOutput(id2);
        }