adplus-dvertising

Welcome to the Delegates and Generics MCQs Page

Dive deep into the fascinating world of Delegates and Generics with our comprehensive set of Multiple-Choice Questions (MCQs). This page is dedicated to exploring the fundamental concepts and intricacies of Delegates and Generics, a crucial aspect of C# programming. In this section, you will encounter a diverse range of MCQs that cover various aspects of Delegates and Generics, from the basic principles to advanced topics. Each question is thoughtfully crafted to challenge your knowledge and deepen your understanding of this critical subcategory within C# programming.

frame-decoration

Check out the MCQs below to embark on an enriching journey through Delegates and Generics. Test your knowledge, expand your horizons, and solidify your grasp on this vital area of C# programming.

Note: Each MCQ comes with multiple answer choices. Select the most appropriate option and test your understanding of Delegates and Generics. You can click on an option to test your knowledge before viewing the solution for a MCQ. Happy learning!

Delegates and Generics MCQs | Page 5 of 7

Q41.
What will be the output of given set of code?
{
 delegate string f(string str);
 class sample
 {
     public static string fun(string a)
     {
         return a.Replace('k', 'o');
     }
 }
 class Program
 {
     static void Main(string[] args)
     {
         f str1 = new f(sample.fun);
         string str = str1("Test Ykur C#.NET Skills");
         Console.WriteLine(str);
         Console.ReadLine();
     }
 }
}
Discuss
Answer: (c).Test Your C#.NET Skills
Discuss
Answer: (d).Only one method can be called using a delegate
Q43.
Select the modifiers which control the accessibility of the delegate:
Discuss
Answer: (d).all of the mentioned
Q44.
What is meant by the term generics?
Discuss
Answer: (a).parameterized types
Q45.
Are generics in C# are same as the generics in java and templates in C++?
Discuss
Answer: (b).No
Discuss
Answer: (d).All of the mentioned
Q47.
What does the following code block defines?

class Gen<T>
{
T ob;
}
Discuss
Answer: (a).Generics class declaration
Q48.
What does the following code set defines?

public Gen(T o)
{
ob = o;
}
Discuss
Answer: (c).Generic constructor declaration
Q49.
Select the type argument of an open constructed type?
Discuss
Answer: (c).Gen<>
Q50.
Which among the given classes is present in System.Collection.Generic.namespace?
Discuss
Answer: (a).Stack
Page 5 of 7

Suggested Topics

Are you eager to expand your knowledge beyond C# programming? We've curated a selection of related categories that you might find intriguing.

Click on the categories below to discover a wealth of MCQs and enrich your understanding of Computer Science. Happy exploring!