C# Programming - Generics
Why should I learn to solve C# Programming questions and answers section on "Generics"?
Learn and practise solving C# Programming questions and answers section on "Generics" to enhance your skills so that you can clear interviews, competitive examinations, and various entrance tests (CAT, GATE, GRE, MAT, bank exams, railway exams, etc.) with full confidence.
Where can I get the C# Programming questions and answers section on "Generics"?
IndiaBIX provides you with numerous C# Programming questions and answers based on "Generics" along with fully solved examples and detailed explanations that will be easy to understand.
Where can I get the C# Programming section on "Generics" MCQ-type interview questions and answers (objective type, multiple choice)?
Here you can find multiple-choice C# Programming questions and answers based on "Generics" for your placement interviews and competitive exams. Objective-type and true-or-false-type questions are given too.
How do I download the C# Programming questions and answers section on "Generics" in PDF format?
You can download the C# Programming quiz questions and answers section on "Generics" as PDF files or eBooks.
How do I solve C# Programming quiz problems based on "Generics"?
You can easily solve C# Programming quiz problems based on "Generics" by practising the given exercises, including shortcuts and tricks.
- Generics - General Questions
- Stack
- Tree
- SortedDictionary
- SortedArray
public class Generic<T>
{
public T Field;
public void TestSub()
{
T i = Field + 1;
}
}
class MyProgram
{
static void Main(string[] args)
{
Generic<int> gen = new Generic<int>();
gen.TestSub();
}
}
- Generics is a language feature.
- We can create a generic class, however, we cannot create a generic interface in C#.NET.
- Generics delegates are not allowed in C#.NET.
- Generics are useful in collection classes in .NET framework.
- None of the above
public class TestIndiaBix
{
public void TestSub<M> (M arg)
{
Console.Write(arg);
}
}
class MyProgram
{
static void Main(string[] args)
{
TestIndiaBix bix = new TestIndiaBix();
bix.TestSub("IndiaBIX ");
bix.TestSub(4.2f);
}
}