adplus-dvertising
frame-decoration

Question

Which of these is a correct way of defining generic method?

a.

name(T1, T2, …, Tn) { /* … */ }

b.

public name { /* … */ }

c.

class name[T1, T2, …, Tn] { /* … */ }

d.

name{T1, T2, …, Tn} { /* … */ }

Answer: (b).public name { /* … */ }

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. Which of these is a correct way of defining generic method?

Similar Questions

Discover Related MCQs

Q. Which among the given classes is present in System.Collection.Generic.namespace?

Q. Select the type argument of an open constructed type?

Q. What does the following code set defines?

public Gen(T o)
{
ob = o;
}

Q. What does the following code block defines?

class Gen<T>
{
T ob;
}

Q. Choose the advantages of using generics?

Q. Are generics in C# are same as the generics in java and templates in C++?

Q. What is meant by the term generics?

Q. Select the modifiers which control the accessibility of the delegate:

Q. Incorrect statements about delegates are?

Q. Which of the following are the correct statements about delegates?

Q. Choose the statements which makes delegate in C#.NET different from a normal class?

Q. Which of the following statements is correct about a delegate?

Q. Choose the incorrect statement about delegates?

Q. Which among the following differentiates a delegate in C#.NET from a conventional function pointer in other languages?

Q. Which of the following is an incorrect statement about delegate?

Q. Which among the following is the correct statement about delegate declaration ?

delegate void del(int i);

Q. Choose the incorrect statement among the following about the delegate?

Q. To generate a simple notification for an object in runtime, the programming construct to be used for implementing this idea?

Q. Suppose a Generic class called as SortObjects is to be made capable of sorting objects of any type(integer, single, byte etc).Then, which of the following programming constructs is able to implement the comparison function?

Q. To implement delegates, the necessary condition is?