What are generic functions and generic classes?

Showing Answers 1 - 1 of 1 Answers

samiksc

  • Jan 20th, 2006
 

Generic classes are those which describe the functionality without being bound to any data type. These classes can be used to generate definitions of classes which are bound to a particular data type. A good example is an Array class. Functionality of array class will be the same irrespective of whether the array members are int, float or string.

Generic functions are similarly those which describe the algorithm without specifying a particular data type.

In C++ generic classes and functions are implemented using templates.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions