PDF Google Drive Downloader v1.1


Report a problem

Content text net-2-tong-hop-cau-hoi (1).pdf

Introduction of Indexers 1. Choose the correct statement among the followings? a) Indexers are location indicators b) Indexers are used to access class objects c) Indexer is a form of property and works in the same way as a property d) All of the mentioned 2. Choose the keyword which declares the indexer? a) base b) this c) super d) extract 3. Choose the operator/operators which is/are not used to access the [] operator in indexers? a) get b) set c) access d) all of the mentioned 4. Choose the correct statement among the following? a) A property can be a static member whereas an indexer is always an instance member b) A get accessor of a property corresponds to a method with no parameters whereas get accessor of an indexer corresponds to a method with the same formal parameters lists as the indexer c) It is an error for indexer to declare a local variable with the same name as indexer parameters d) All of the mentioned 5. For a class student consisting of indexer, which among the following declaration of indexers runs the C# code successfully? student a = new student(); a[1,2] = 20; a) class student { int[,] p = new int[6, 6]; public property WriteOnly int this[int i, int j] { set { a[i, j] = value; } } } b) class student 4. What will be the output of the following C# code snippet? class Program { static void Main(string[] args) { Expression> IsFactorExp = (n, d) => (d != 0) ? (n % d) == 0 : false; Func IsFactor = IsFactorExp.Compile(); if (IsFactor(10, 5)) Console.WriteLine("5 is a factor of 10."); if (!IsFactor(343, 7)) Console.WriteLine("7 is not a factor of 10."); Console.ReadLine(); } } a) Compile time error b) Run time error c)5 is a factor of 10 7 is not a factor of 10 d) 5 is a factor of 105. Choose the namespace in which Expression trees are encapsulated? a) System.Linq b) System.Linq.Expressions c) System.Text d) System.Collections.Generic 6. In the following C# code, which query will work according to the set of code?class Program { static void Main(string[] args) { int[] nums = { 1, -2, 3, 0, -4, 5 }; int len = /*_________________ */ Console.WriteLine("The number of positive values in nums: " + len); Console.ReadLine(); } } a)from n in nums where n > 0 select n b)from n in nums where n > 0 select n.Count() c)(from n in nums where n > 0 select n).Count(); d) Both “from n in nums where n > 0 select n.Count()” & “(from n in nums where n > 0 select n).Count();”7. In the following C# code, what does the output represent?class Program 1 Downloaded by Ng?c Th?o ([email protected]) lOMoARcPSD|23378391


Related document

x
Report download errors
Report content



Download file quality is faulty:
Full name:
Email:
Comment
If you encounter an error, problem, .. or have any questions during the download process, please leave a comment below. Thank you.