Discussion :: C#.Net MCQs
-
What does the following code block define?class Gen
{ T ob;}
A.
Generics class decleration
|
B.
Decleration of variable
|
C.
a simple class decleration
|
D.
Both a & b
|
Answer : Option D
Explanation :
class Gen This defines the generics declaration where 'T' is the name of type parameter.This parameter is used as a placeholder for the actual type that will be specified when a Gen object is created.Gen is a generic class . T is used to declare a variable called 'ob'.
Be The First To Comment