1
Reply

What is the difference between Generic Class and Generic Procedure

Manish Tewatia

Manish Tewatia

Jul 19, 2010
8.7k
0

    A generic procedure, also called a generic method, is a procedure defined with at least one type parameter. This allows the calling code to tailor the data types to its requirements each time it calls the procedure.

    A procedure is not generic simply by virtue of being defined inside a generic class or a generic structure. To be generic, the procedure must take at least one type parameter, in addition to any normal parameters it might take. A generic class or structure can contain nongeneric procedures, and a nongeneric class, structure, or module can contain generic procedures.

    A generic procedure can use its type parameters in its normal parameter list, in its return type if it has one, and in its procedure code.

    saeed shirzadian
    July 21, 2010
    0