Savol №187 ArrayList list = new ArrayList() {1, 2, 3, 4, 5}; list.InsertRange(4, list); list.RemoveRange(6, 4); foreach (var l in list) richTextBox2.Text += l; Javoblardan birini tanlang:
1) 123123 2) 123451 3) 12345 4) 123412 Savol №188 textBox1 da -4 textBox2 da -2 kiritilganida quyidagi dasturiy kod bajarilishi natijasida labelda qanaqa qiymat hosil bo'lishini aniqlang double a, b, c; a = Convert.ToDouble(textBox1.Text); b = Convert.ToDouble(textBox2.Text); c = (a + b) / (b * b + Math.Abs((b * b + 2) / (a + a * a * a / 5))); label1.Text = c.ToString(".#"); Javoblardan birini tanlang:
1) 1.6 2) -1.4 3) -1.6 4) 1.1 Savol №189 Quyidagi dastur kodi bajarilishi natijasida Console da qanaqa qiymat hosil bo'ladi? static void Main(string[] args) { Voris value = new Voris(); Console.WriteLine(value.metod1(value.metod2(5))); } class Asosiy { public int metod1(int b) {return b--;} } class Voris:Asosiy { public int metod2(int b) {return ++b;} } Javoblardan birini tanlang:
1) 3 2) 6 3) 4 4) 5 Savol №190 class Counter { public int Number { get; set; } // qo'shish operatorini aniqlash } Bu sinfda int tipidagi int tipidagi ob'yekt bilan Counter ob'yektini qo'shish operatori aniqlangan: Counter counter = new Counter { Number = 45 }; int x = counter + 6; Console.WriteLine(x); Counter sinfida aynan qaysi operator aniqlanganini toping Javoblardan birini tanlang:
1) public static Counter operator + (int val, Counter counter) { return new Counter {Number = counter.Number + val}; } 2) public int operator + (Counter counter, int val) { return counter.Number + val; } 3) public static Counter operator + (Counter counter, int val) { return new Counter {Number = counter.Number + val}; } 4) public static int operator + (Counter counter, int val) { return counter.Number + val; }